Comment 3 for bug 1424815

Revision history for this message
Kathy Lussier (klussier) wrote :

I took some time to look at this code over the past couple of days. Overall, the code in Jake's part 1 branch was successful in displaying more contents of the field. However, I wasn't a big fan of the way it displayed the additional content - see the screencast at https://drive.google.com/file/d/0B74gDMUDwDXqeU50VHdMdVpQLUk/view?usp=sharing.

The rest of the field displays after the 'read more' text, and I had trouble finding a way to change that behavior using the checkbox implementation. I decided to try a simpler CSS approach than what Jake was using. I've added a commit to the above work-in-progress branch that shows my proposed implementation. Still no javascript required.

I have a few todos I still want to work on:
- The current implementation only works with note fields. We have a local use case for truncating the title field on the search results page as well. I would like to add a setting to make that happen for sites that want it.
- We need to account for undefined cont.trunc_length fields
- I would like to put more settings in config.tt2. On the one hand, I like the fact that we can define the maximum character length before truncation on a field-by-field basis. But I also think it will be easier for most sites to just turn it on and identify the maximum character length in one setting for all notes.

Before I work on the remaining to dos, I would like to get some feedback on the branch just to make sure I'm moving in the right direction.

Alternatively, if bug 1642086 is merged, we could explore using the "Read More" jquery plugin. However, since one of the guidelines for jquery use was to only use it for things that can't be handled easily without javascript, I wanted to first see if I could get Jake's code working without the need to use javascript.

I have a working implementation of it at https://mlnc4.noblenet.org/eg/opac/record/249 if anyone wants to see it in action.