After many trial-and-error I finally got it! The file that needs modifying is:
(JOOMLA ROOT)/layouts/joomla/content/category_default.php
To create a template override, copy it to:
(JOOMLA ROOT)/templates/(TEMPLATE)/html/layouts/joomla/content/category_default.php
Then, find the line that says:
and replace it with:
I hope future versions of Joomla will add this option to the Category List item. Until then, this code makes a nice fix.
(JOOMLA ROOT)/layouts/joomla/content/category_default.php
To create a template override, copy it to:
(JOOMLA ROOT)/templates/(TEMPLATE)/html/layouts/joomla/content/category_default.php
Then, find the line that says:
Code:
<?php echo $displayData->loadTemplate($displayData->subtemplatename); ?>
Code:
<?php$items = $displayData->get("items");$topLevelArticles = [];foreach ($items as $item){if ($item->catid == $category->id)$topLevelArticles[] = $item;}$displayData->set("items", $topLevelArticles);echo $displayData->loadTemplate($displayData->subtemplatename);?>
Statistics: Posted by NetRod2 — Wed Dec 18, 2024 5:17 pm