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.
Labels |
Added:
?
|
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.
Do you by chance have Template Style
option set to some template style in the menu item?
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.
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
Global Config:
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.
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.
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...
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.
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.
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.
The issue is that the alternative layout (which is viewable and selectable from both the global configuration and the contact category) is completely ignored. (Not to mention the option is not even available in the menu item.) This behavior is different to the more popular core components like com_content.
It’s either a bug or the fields that don’t do anything need to be removed.
The XML route is a workaround but definitely not ideal.
On Dec 29, 2020, 12:03 AM +0200, Brian Teeman notifications@github.com, wrote:
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.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
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.
I totally agree.
See the discussion here as well - that also went nowhere https://github.com/joomla/joomla-cms/issues/23533e
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.)
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.
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
Labels |
Added:
No Code Attached Yet
bug
Removed: ? |
Did you also make a copy of the XML file?