J1.5

How to control Category List layouts when drilling from a Section Layout

From Joomla! Documentation

Revision as of 12:46, 10 May 2010 by Vatt2001 (talk | contribs) (Added additional core hack that may be needed)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

The "J1.5" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

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.

  1. Say you have a Section called Dogs with 2 Categories: Collie and Beagle.
  2. Create the Section List Layout for Dogs as normal.
  3. 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.
  4. 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[edit]

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));