Difference between revisions of "How to control Category List layouts when drilling from a Section Layout"
From Joomla! Documentation
m (→If it does not work: clean up categories with <noinclude> tags)
m (Hutchy68 moved page How to control Category List layouts when drilling from a Section Layout to J1.5:How to control Category List layouts when drilling from a Section Layout: namespacing)
Revision as of 21:05, 26 May 2013
In Jooomla! 1.5, a Section List layout presents a list of Categories for this section. When you select a Category link, a Category List layout shows for the this Category.
Normally, when you add a Menu Item for a Category List, you have the option to set a number of parameters to control the details of how the page will display. For example, you can set whether to show or hide column headings, date, filter table, and so on. However, when you set up a Section List Menu Item, there is no place to enter parameters to control these options for the Category List pages that show after you drill down.
So, what happens? It depends on whether you have a Category List or Category Blog Menu Item for this Category. If you do, then Joomla! will use the parameters from that Menu Item. Otherwise, Joomla! will use default values when you drill down to a Category List from the Section List.
You can control how this drill down works by creating separate Category List Menu Items for each Category in the Section. Here is an example.
- Say you have a Section called Dogs with 2 Categories: Collie and Beagle.
- Create the Section List Layout for Dogs as normal.
- Create a new Menu called "hidden". Do not create a Module (mod_mainmenu) for this Menu. This menu will not show on the site. It will only be used to create Menu Items.
- On the "hidden" menu, create a separate Category List Menu Item for Collie and Beagle. Set the parameters for each of these to the desired values to control the display.
Now, when you drill down from the Dogs Section List to Collie or Beagle, the parameter values from the Collie or Beagle Menu Items will be used to control the display. Note that, if you add a new Category in the future (for example, Poodle), you will also have to add a new Category List Menu Item for this new Category.
If it does not work
Probably you may also need a hack in core file /components/com_content/views/section/view.html.php (line 96):
$category->link = JRoute::_(ContentHelperRoute::getCategoryRoute($category->slug, $category->section).'&layout=default');
You should remove ".'&layout=default'" text, so the line will become:
$category->link = JRoute::_(ContentHelperRoute::getCategoryRoute($category->slug, $category->section));