2

As we all know in Joomla Article page, a read more functionality is always possible <hr id="system-readmore"> to show the article in introtext/fulltext format.

But in Category description page that read more functionality option isn't available. So if I want to add that similar kind of Read More functionality in the Category page section, what should I do? I have tried but couldn't find any solution for this.

Is there any plugin available for that? Or can I do this in another way?

4

Technical Answer: No this isn't possible in a simple way. The reason that articles have a readmore is because we actually separate the text and store it in different database columns when we bind it to the table object (https://github.com/joomla/joomla-cms/blob/3.4.1/libraries/legacy/table/content.php#L123-L137). i.e. none of this is done in a plugin. The readmore plugin (editors-xtd) is simply a mechanism for easily allowing you to insert such an HR tag into the article body - disable that and this split will still continue to work.

The best way to code this in a plugin way you could hope for is to build your own content plugin on the onContentPrepare event and implement code similar to that in the ContentTable class I put above. You could then create your full_text and intro_text variables there. The integration plugin between com_content and com_contact is probably helpful as a basis for this work (https://github.com/joomla/joomla-cms/blob/3.4.1/plugins/content/contact/contact.php) and what you're doing should be much simpler than what this plugin does - as you can just look at the existing data without needing custom db queries. It should only need to be a dozen or so lines of code I think.

TL/DR no not in any easy way - although I have suggested a way around it (note I haven't checked JED so it's always possible someone has already done this :P)

  • Thank you George for your suggestion. Its really good and I am trying really hard to get it done. But I am not sure whether I can pull it through or not. So I would be really grateful to you if you can do this code for me since you are quite expert and knowledgeable regarding this joomla cms and their structure. For last one month I have tried in many ways to find out a solution for this issue and you give me the best possible answer to sort out the issue. So thank you for that. – indy Apr 20 '15 at 9:33
  • github.com/wilsonge/category-rm/releases/tag/1.0.0 download the plg_content_categoryrm.zip here and read the readme here github.com/wilsonge/category-rm on how to use the plugin in your code (it requires a template override) – George Wilson Apr 21 '15 at 23:41
  • thank you a lot and I am going to implement it as per your suggestion. – indy Apr 22 '15 at 0:23
  • I have done all the things that you mentioned but the category readmore functionality (introtext fulltext) isn't working so i have sent an email on your joomjunk id and hope will get your help on this. – indy Apr 22 '15 at 22:29
0

What I have done is wrap what I considered to be the 'fulltext' of all of my category descriptions inside a div.fulltext. Then, on the menu item of the categories page that is listing all of my categories, in the Page Display tab i have set a Page Class parameter of categorieslist.

Then I have set a css style to 'display:none' for .categorieslist .fulltext. e.g

.categorieslist .fulltext {display: none;}

It isn't pretty but it is a lot easier than trying to mimic the way that the content component does it for articles. And let's face it, how often do you update Category descriptions?

Good luck. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.