joomla / joomla-cms

Home of the Joomla! Content Management System
https://www.joomla.org
GNU General Public License v2.0
4.74k stars 3.65k forks source link

Changing category layout in menu options tab #35005

Closed BrainforgeUK closed 1 month ago

BrainforgeUK commented 3 years ago

Steps to reproduce the issue

Create category. Selecting different category layouts (from template html/com-content/category) works as expected.

Create a category list menu item for that category. The previously selected category layout displays correctly.

What does Choose a layout in the options tab do? It lists article layouts from template html/com-content/article When menu item used in front-end I cannot see anywhere that the selected article layout is used.

It looks like _articlelayout is only used in view/article not in view/category - which is what I would expect, so at this point it looks to me like a 'do nothing option'.

Expected result

Choose a layout in options tab lists category layouts from template html/com-content/category

I would expect this to provide a method to override the selected category layout. I.E. could have 2 menu items with different layout / stylings for the same category article list.

Actual result

Choose a layout in options tab lists article layouts from template html/com-content/article

System information (as much as possible)

Joomla 4 RC5 PHP 7.4

Additional comments

Suggestions (a) Simplest - remove Choose a layout from the options tab (category/default.xml). (b) Change it so that it enables the site dev / admin to override the chosen layout for that category.

brianteeman commented 1 month ago

What does Choose a layout in the options tab do? It lists article layouts from template html/com-content/article When menu item used in front-end I cannot see anywhere that the selected article layout is used. It looks like article_layout is only used in view/article not in view/category - which is what I would expect, so at this point it looks to me like a 'do nothing option'.

The layout option is in the tab labelled Options and the option has a description "layout for items" image

You are correct that the layout is for the display of any article accessed via this menu item. It works correctly as shown in the screen recording below. The one time that you may not see the article layout being used is when the article can also be accessed by another menu item. In that scenario the menu item with the lowest id will take precedence and so you may not see the selected layout. If you only have one menu item pointing to an article (as you should do) then it works correctly as intended.

https://github.com/user-attachments/assets/d3b671dd-780b-4171-a503-7fd42c272f4b

This should be closed as the option works correctly as intended and there is nothing to fix