No Code Attached Yet bug
avatar pieter-groeneweg
pieter-groeneweg
8 Jun 2020

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.

avatar pieter-groeneweg pieter-groeneweg - open - 8 Jun 2020
avatar joomla-cms-bot joomla-cms-bot - change - 8 Jun 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 8 Jun 2020
avatar SharkyKZ
SharkyKZ - comment - 8 Jun 2020

Did you also make a copy of the XML file?

avatar pieter-groeneweg
pieter-groeneweg - comment - 8 Jun 2020

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.

avatar SharkyKZ
SharkyKZ - comment - 8 Jun 2020

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

avatar SharkyKZ
SharkyKZ - comment - 8 Jun 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.

avatar pieter-groeneweg
pieter-groeneweg - comment - 8 Jun 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.

avatar SharkyKZ
SharkyKZ - comment - 10 Jun 2020

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.

avatar pieter-groeneweg
pieter-groeneweg - comment - 10 Jun 2020

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

avatar crystalenka
crystalenka - comment - 28 Dec 2020

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.

avatar brianteeman
brianteeman - comment - 28 Dec 2020

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.

avatar brianteeman
brianteeman - comment - 28 Dec 2020

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.

avatar crystalenka
crystalenka - comment - 28 Dec 2020

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.

avatar brianteeman
brianteeman - comment - 28 Dec 2020

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.

avatar crystalenka
crystalenka - comment - 28 Dec 2020

I totally agree.

avatar brianteeman
brianteeman - comment - 28 Dec 2020

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

avatar crystalenka
crystalenka - comment - 28 Dec 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.)

avatar pieter-groeneweg
pieter-groeneweg - comment - 29 Dec 2020

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

avatar Hackwar Hackwar - change - 20 Feb 2023
Labels Added: No Code Attached Yet bug
Removed: ?
avatar Hackwar Hackwar - labeled - 20 Feb 2023

Add a Comment

Login with GitHub to post a comment