Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

component alternative layout override is not available in menu item #29484

Open
pieter-groeneweg opened this issue Jun 8, 2020 · 16 comments
Open

Comments

@pieter-groeneweg
Copy link

When i create an alternative layout override for a component, this does become available for selection in the global config for the component.

It does not become available in the menu item editor.

ie. override made to com_contacts/category
made changes to the core files and copied them to template/html/com_contacts/category/
renamed all files replacing "default" with "alternative".

When I check in global config the alternative is there.
When I check in menu item edit. I cannot choose the alternative.

This is in j!3.9, protostar template but also in j!4 cassopeia.

@SharkyKZ
Copy link
Contributor

SharkyKZ commented Jun 8, 2020

Did you also make a copy of the XML file?

@pieter-groeneweg
Copy link
Author

Yes that was copied, but I did not need another menu item type, I need another template layout style. Just like possible for modules layout selection.
The way it is presented in the menu item editor it suggests this works similar.

@SharkyKZ
Copy link
Contributor

SharkyKZ commented Jun 8, 2020

Do you by chance have Template Style option set to some template style in the menu item?

@SharkyKZ
Copy link
Contributor

SharkyKZ commented Jun 8, 2020

If you're talking about Choose a Layout option in Contact Display Options tab, that layout is used for contacts on child pages of the menu item.

@pieter-groeneweg
Copy link
Author

pieter-groeneweg commented Jun 8, 2020

No I am meaning "template style" in details tab

in the menu item, the template style is usually set to default.
I can change the default in global config,
I cannot change this at menu item. I can choose the "defaults" from other templates though.
In j!3.9 that is since that test site has multiple templates, j!4 has just one. Can't tell.

See pictures

Menu Item:
image

Global Config:
image
Even the message in blue suggests you can make these changes in the item.

So yes, I can make a change by going for the whole and create an alternative menu item type, but the fields in menu item template layout and the layout selection in global config suggest this should be easier than that.

Little of topic, creating the alternative menu item would become awesome if we could steer the ACL on these items. Ie. Create an alternative and hide the original from the site managers.

@SharkyKZ
Copy link
Contributor

That's not what template styles are. Template style are different configurations of a template. What you created is a custom layout and it will not appear in Template Style field.

@pieter-groeneweg
Copy link
Author

Mjes maybe confusing then, but I can choose (at least it suggests, did not check if it actually does) a custom layout for the individual item contacts in tab "contact display options".

Which seems nice for when I click a contact from the list. But there is no layout selection possible for the menu item itself then..?

Then the only bypass is to create the menu item type...

@crystalenka
Copy link
Member

I can also confirm that not only are alternative layouts not available in the menu item, they are ignored if selected in the global configuration for contact category, as well as in the options in each category in com_contacts. (So, basically, totally ignored.)

This behavior is unrelated to "template style", as that's something totally different.

@brianteeman
Copy link
Contributor

The only way I have ever got them to work is by creating a menu item for the layout (ie created a new xml). I know that I have opened issues about this in the past and was always told that this is the intended behaviour. Which I admit to not understanding or agreeing.

@brianteeman
Copy link
Contributor

I think the problem is that they are alternatives to the identically named default layout. Whereas what we have all done is to create a new layout that is not an alternative to anything.

@crystalenka
Copy link
Member

crystalenka commented Dec 28, 2020 via email

@brianteeman
Copy link
Contributor

The XML route is a workaround but definitely not ideal.

As I said I think there is both a confusion about what the alternate layout is and the code and the ui.

@crystalenka
Copy link
Member

I totally agree.

@brianteeman
Copy link
Contributor

See the discussion here as well - that also went nowhere https://github.com/joomla/joomla-cms/issues/23533e

@crystalenka
Copy link
Member

crystalenka commented Dec 28, 2020

I wouldn't have a big problem with not being able to select the layout in the menu if selecting it the other places worked. In com_contact it's just always ignored. That's a genuine bug.

I understand the deeper architectural discussion in the other thread and I do agree that it's not ideal either, but I can also see why not being able to select the category layout from the menu item is not necessarily a "bug" in technical sense. (UX is another matter, as always.)

@pieter-groeneweg
Copy link
Author

Well, point is that the average user is not too much interested in the "technical sense".
UX is far more important.
While it does work in modules one expects it to work in components (menu item) also. The average user doesn't see a difference between "layout" and "Template style". Also bearing all users in mind that do not have English as a native language.

If it is not to work that way, remove the "suggestion" it does. Get rid of the "- Default" options in the dropdown. Just mention the available styles (templates) by template name. Currently, drop down options have a header (template name) Which is useless since I cannot have multiple options per template.

ie.

image

If the override with added XML is the solution to stay, my suggestion would be to get rid of the word "style" and also to simplify the dropdown in the menu item editor. This to avoid expectations.

@brianteeman , your link has a trailing "e" for some reason.
correct link is: #23533

@Hackwar Hackwar added the bug label Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants