Keyword

Add Read More Buttons To Reveal More Text

  • Trevor J Ellis
  • Trevor J Ellis's Avatar Topic Author
  • Offline
  • New Member
More
3 years 2 months ago #179472 by Trevor J Ellis
Add Read More Buttons To Reveal More Text was created by Trevor J Ellis
On this page on our site -  woldstest.users70.interdns.co.uk/the-team , I want to be able to add read more text wrapper buttons like this site -  willows.uk.net/the-team/specialist-team/anaesthesia/ .We are using the Uber template, K2 and the JCE editor. Ideally, I want to be able to show the name (e.g. Pete Dixon), the job title (e.g. Veterinary Surgeon – Director) and the first paragraph under that by default (I also want the picture for each staff member displayed by default) then have any additional paragraphs hidden unless you click the Read More button. I want this to be the same for all Staff members' biographies on the page.I've tried following multiple guides online but they often break when I have more than 1 read more button and they never quite display the text how I want it in different paragraphs.How do achieve what I'm trying to do? What HTML code and CSS code do I need? Will I need to use any JavaScript, I've got JS enabled for the text editor. Any help would be greatly appreciated. Thanks in advance.

Please Log in or Create an account to join the conversation.

  • Trevor J Ellis
  • Trevor J Ellis's Avatar Topic Author
  • Offline
  • New Member
More
3 years 2 months ago #179475 by Trevor J Ellis
Replied by Trevor J Ellis on topic Add Read More Buttons To Reveal More Text
I could really use some help on this issue. I've tried following other guides online but none have been quite what I was looking forward. Any assistance or suggestions from anyone would be greatly appreciated.

Please Log in or Create an account to join the conversation.

More
3 years 2 months ago #179487 by JoomlaWorks
Replied by JoomlaWorks on topic Add Read More Buttons To Reveal More Text
This is just JS code that enforces a fixed height on the introtext container if it's larger than a specified value - and as bonus adds a "read more" to expand the container. This is purely templating stuff.

Start here getk2.org/documentation/tutorials/templating-with-k2-and-the-concepts-of-sub-templates and create your own set of overrides. Then modify this file github.com/getk2/k2/blob/master/components/com_k2/templates/default/category_item.php (which loads the introtext for each item rendered in a category) and adjust the HTML as you like (in order to fit any JS code for the effect you desire).

Just keep in mind that such "moving" elements are generally discouraged because they force a browser reflow of the page (and discouraged by Google's performance guidelines in general developers.google.com/speed/docs/insights/browser-reflow).

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Trevor J Ellis
  • Trevor J Ellis's Avatar Topic Author
  • Offline
  • New Member
More
3 years 2 months ago #179495 by Trevor J Ellis
Replied by Trevor J Ellis on topic Add Read More Buttons To Reveal More Text
Thanks for your help. However, I don't really understand what to do anyway. Where can I find code that will do what I want? I've been searching all over and nothing really does what I want. I just want it to display the first paragraph under the name and job title then if you click a "Read More" button, it reveals more of that text. I don't really want to mess with the .php files. I just want it so you click button and more text is revealed. Is there a module or plugin that will achieve this?

Please Log in or Create an account to join the conversation.

More
3 years 2 months ago #179501 by JoomlaWorks
Replied by JoomlaWorks on topic Add Read More Buttons To Reveal More Text
I'm afraid there is no such extension to do what you want. And it does require some frontend-coding skills to make this happen...

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum