When events are propagated to our event/calendar page (http://www.wcdemocrats.com/events) they have a "show all" & "show less" link dropped into the content. Is there a way to use this function for other content on the site? What I would like to do is truncate a block of content then reveal the entire block of content with show all and show less links. Can I use the native functionality of NB to achieve this throughout our site? Thanks, Bob
Official response from Brian Palmer
Hey Bob! Good thinking - this is definitely something you can do. A block of text will show/hide like that as long as it is in a div element that looks like this:
In my example, it would truncate it to 300 characters, but you can change that to whatever you'd like!
Share this post
Showing 3 reactions
Sign in with
After a bit of digging and looking under the hood yesterday, I found the truncate code. Worked great on one div, the problem is I want to apply this to a few divs on a page, with each div having a different truncate number. I tried this with with two divs, one with set to truncate=200 and the other set to truncate=420. I’m using this on a Volunteer page in the a descriptive div for each roll. I tried switching them around. Which ever item loads first on the page seems to set the default truncate value.
http://www.wcdemocrats.com/new_volunteer
This is a temporary test page, this link my not be live forever.
Might have to find a different solution. Thinking about a popup modal with the description for each roll.
If you have any thoughts, let me know.
Bob