Expand content with "Read more" link on bottom1 user found helpful
I would like to have long articles show just the first paragraph of the text, followed by a "Read more" link, but when the link is clicked, I want the content box to expand and show the full article.
The link would still be at the bottom of the article, and if clicked would collapse back to showing only the first paragraph.
The standard "Read more" option in Concrete links to the article page url. I'm looking for something more dynamic.
There are add-ons to expand and collapse content, but they have the button/link on the top instead of the bottom and they switch between no content/all content, instead of switching between 1st paragraph/all content.
Anyway, I don't yet know how I should tackle this challenge with Concrete. Any ideas or pointers?
Place this link in your copy:
<p>This is your first paragraph</p>
<a href="#" title="" id="hidden-content-reveal">Click here to reveal content »</a>
Have this element with your hidden content:
<div id="hidden-content">Hidden Content</div>
Link to jQuery:
And this is your script:
I think I'll use some code to search for page breaks, which look like "<!-- pagebreak --></p>", and automatically split the article into the hidden content div from there.
Don't know exactly how yet, but I'll figure that out later..)
By the way, doesn't Concrete include the jQuery code by default?