I want to have a page listing each sub-category in a category but with each subcategory showing n number of caracters from the most recent article in each sub-category. The layout I am after is something like this.

Main category Title

  • Sub-category 1 - First x number of characters from most recent article
  • Sub-category 2 - First x number of characters from most recent article
  • Sub-category 3 - First x number of characters from most recent article

It would be OK for the first x number of characters to go below each sub-category name. It would be acceptable to use read-more and just have what's above showing as I can achieve x number of characters like that.

I want all the sub-categories listed like this and I don't want a list of sub-categories repeated again below.

I have tried menu item Category list and Category blog but neither seems to show text of articles in sub-category.

up vote 1 down vote accepted

I can see a couple of options depending on your situation.

Option 1.

If you sub-categories are not going to change then you could set up a 'Articles - Category' module for each sub-category. This allows you set the number of articles to show and the introtext limit will allow you to show a set number of characters. Then make a category blog list showing 0 items but with the category description showing. Then in the category description set out the modules using loadpositions like this:

Custom Title And Link to Subcat1

{loadposition some_custom_position_set_in_the_module_1}

Custom Title And Link to Subcat2

{loadposition some_custom_position_set_in_the_module_2}

Custom Title And Link to Subcat3

{loadposition some_custom_position_set_in_the_module_3}

This will give you detailed control over the display without having to edit any php. You would only load it in a category description like I suggest to keep your URI structure nice, but this may or may not apply to you.

Option 2.

Write a category blog template override. documentation is here https://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core

  • Thanks. Creating modules for each category listing the sub-categories and then loading those in an article is what I went for in the end. – Kirsten Feb 12 '17 at 9:59

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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