?
avatar Marc-oO
Marc-oO
18 Mar 2016

Steps to reproduce the issue

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

Expected result

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

screen shot 2016-03-18 at 04 59 36

Actual result

my custom layout "myblog" is not in the list :(
see screenshot

System information (as much as possible)

All joomla3 versions concerned

Additional comments

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

avatar Marc-oO Marc-oO - open - 18 Mar 2016
avatar wilsonge
wilsonge - comment - 20 Mar 2016

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 :(

avatar wilsonge wilsonge - change - 20 Mar 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-03-20 20:49:19
Closed_By wilsonge
avatar wilsonge wilsonge - close - 20 Mar 2016
avatar wilsonge wilsonge - close - 20 Mar 2016
avatar Marc-oO
Marc-oO - comment - 20 Mar 2016

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 ?
68747470733a2f2f6973737565732e6a6f6f6d6c612e6f72672f75706c6f6164732f312f64396130626662623033373835363230616430326566336666623961643962652e706e67

List visible here : mysite.com/administrator/index.php?option=com_categories&view=category&layout=edit&extension=com_content Parameters tab.

avatar wilsonge
wilsonge - comment - 20 Mar 2016

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.

avatar Marc-oO
Marc-oO - comment - 20 Mar 2016

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 ?

Add a Comment

Login with GitHub to post a comment