Puzzled by alternative layouts not working?
My puzzle was that my alternative layout for a category blog would not show up as a choice in the category manager.
I turned to the Joomla Forum and found that others had posted about their alternative layouts not being implemented, even when they chose them for a particular category.
Here’s what I posted in reply:
Alternative layouts will NOT be implemented if a menu item pointing to that category exists. (Even if you arrive at the category via list, or other non-menu link.)
I have created templates/my-template/hmtl/com_content/category/blogworm.php as well as blogworm_item.php and blogworm_item.xml.
I have added lines in the .sys.ini language file for the new menu item type.
When I choose the alternative menu item, then my layout overrides are applied to the blog display of the category.
But it is not possible for me to select this category override in the category manager options or category manager for a particular category — it does not appear in the menu of alternative layouts.
Having the .xml file precludes the use of the alternative as a an option to be selected at the category or item level.
I cloned my .php files with yet another name and the alternative layout was then available at the category level — and it worked on a category that had no menu item pointing to it.
The presence of the .xml file turns your layout override into a custom menu item type. If you want or need both, you’ll have to clone the .php file with a new name.