Create a custom layout in your frontend template :
/templates/mytemplate/html/com_content/category/myblog.xml (copy of blog.xml)
/templates/mytemplate/html/com_content/category/myblog.php
Create a new content category (Goto : /administrator/index.php?option=com_categories&view=category&layout=edit&extension=com_content)
Goto tabs "parameters" > "Layout" > select my custom layout "myblog" in the list
my custom layout "myblog" is not in the list :(
see screenshot
All joomla3 versions concerned
Solution :
In ./libraries/legacy/form/field/componentlayout.php +195
replace
|| (in_array(basename($file, '.php'), $xml_files)))
by
&& (!in_array(basename($file, '.php'), $xml_files)))
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-03-20 20:49:19 |
Closed_By | ⇒ | wilsonge |
Forgot my previous message, just look at the screenshot, if your template embeds custom com_content/category layout(s), WHY thoses custom layouts arent listed in the dropdown list ?
List visible here : mysite.com/administrator/index.php?option=com_categories&view=category&layout=edit&extension=com_content Parameters tab.
Because Component Layouts (with a PHP File) and Menu Types (for Menu Manager with an XML file) are treated differently by the CMS.
If you remove the XML file then you can use it in Articles and Categories but not in the Menu Manager.
Ok, so there is an other bug.. maybe not part of the "component layout" field.. If you create a menu Item (with a custom Layout com_content/category) in order to display articles of multiple categories AND subcategories, the first page will have the good layout (the custom) but if you go deeper, in a subcategory, the layout will not be the good one. Do you need steps to reproduce the issue ?
This is intended. Basically if you choose to supply an article XML field then its designed to be used in the menu manager as an alternative menu item type. If you wish to choose it in article menu then you must only supply the php file WITHOUT an xml file.
I'm not sure why this was made the intended behaviour but it would be a massive b/c break to change at this point in Joomla 3 - sorry :(