How I got to the issue:
The override for mod_menu should work like given in the child template.
The override of the child template is not working.
You have to explicitely choose the child template override in the module.
PHP 8.0.x but doesn't matter I guess
J 4.2.5
If a template introduces a new layout file like collapse-metismenu.php, it should be automatically overridden by a child template.
The names in the layout setting for the different files in mod_menu settings, advanced tab is a bit confusing too:
Cassiopeia calls collapse-metismenu.php Collapsable Dropdown.
The child template uses the file name to generate the name to choose: collapse-metismenu.
It's all a bit inconsistent.
I guess it is intended by Joomla to use all child template files automatically.
So in advanced tab there might be a setting missing.
From cassiopeia/main template OR child -> missing
From module -> is there
From cassiopeia template -> is there
From cassiopeia_child -> is there
Default setting should be the one that I declared as missing. Kind of an automatic setting.
By default setting Joomla should take the template file/override or if available the child override file.
Template override available - no child override -> use template.
Template override available - child override available -> use child.
No template override - child override available -> use child.
No template override - No child override -> use base module.
The problem at the moment:
If someone would import a child template with various overrides, they would not work until every module is set to use the child template.
I got aware of this problem by someone stating that the child template would not work.
So this automatic setting would lead to a lot less user frustration.
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
I just enabled the child template and was expecting that all the overrides in the child template would work.
It's a child template with basically just the mod_menu override.
I just changed navbar navbar-expand-md to navbar navbar-expand-lg.
It's a child template with basically just the mod_menu override.
I think you're not getting what I'm trying to explain: the enable child as default template is not the same as assigning all the menus to the child template. Give it a try...
I don't want to assign menus to the child template. The menus should be assigned to the parent template. I just want to add a different layout to a module. The parent should do the work, the child should change the layout.
I don't want to assign menus to the child template. The menus should be assigned to the parent template. I just want to add a different layout to a module. The parent should do the work, the child should change the layout.
@StefanSTS This is not how it works. Your expectation is wrong.
Maybe the system is too limited.
I would expect everything not set on the child to be inherited from the parent.
Saying my expectation is wrong expresses not too much motivation to think further.
A simple automation of the inheritance could make the system so much simpler to use. Like in other Joomla template systems that use this for the last ten years.
Can you clairfy please. Are you saying that you have set the default site template style to be the child template and the module override is not working?
Well, if that is the case, then it is indeed a bug, and I misunderstood. If not and the expected behavior makes sense, it would be a feature request. Anyway it could be that our documentation is not really complete.
I have set the default site template style to be the child template and the module override for com_menu collapse-metismenu.php is not working.
Only if I set the module layout explicitely to the child template it works.
It might have to do with the fact that Cassiopeia introduces collapse-metismenu.php which is not present in core mod_menu.
ah got it - I understand what is happening now and why it is the expected behaviour
You have a module and it is set to use the cassiopeia module override/
You now create a child template and create a new override of the module
You set the child template as default
You expected the module that had been explicitly set to use a specific layout to magically change without you doing anything and to use a different layout in the child template.
If I have described everything correctly then it is not only expected behaviour but also the intended and desired behaviour.
You expected the module that had been explicitly set to use a specific layout to magically change without you doing anything and to use a different layout in the child template.
Yes, I thought it would magically use
child template's collapse-metismenu.php
over
parent template's collapse-metismenu.php.
In the same way as it magically changes when I make an override in Cassiopeia for mod_login/default.php.
If I enable Cassiopeia it shows me "Hello Parent".
If I enable Cassiopeia Child it shows me "Hello Child".
Got the child activated here: https://php80.sts-hosting.de/j4vm3/ without changing layout settings in the advanced tab.
If I have described everything correctly then it is not only expected behaviour but also the intended and desired behaviour.
It might look like it is the expected behaviour, but it's not consistent compared to the behaviour of default.php.
In case menu it does not override the parent.
In case login it does override the parent.
In both cases there is a set layout, once default(.php) From Module, once collapse-metismenu(.php) from Cassiopeia.
The problem is either,
I send this now and read it again to understand myself.
Tested another theory:
Added collapse-metismenu.php to the core module.
Used navbar-expand-sm.
Cassiopeia has navbar-expand-md.
Cassiopeia Child has navbar navbar-expand-lg.
Frontend shows -lg -> Showing the child template.
Setting in the module is set "explicitly" to From Module - collapse-metismenu.
This supports my theory that it only works when there is the same layout in the core module, because there you can explicitly set it to From Module, BUT explicitly or not, it uses Cassiopeia -> Cassiopeia Child.
Following this logic, I still expect that if the file is not in core, but I explicitly set the layout in Cassiopeia, it will be overridden by the child.
@StefanSTS check if #39308 is what you are after.
@brianteeman @richard67 probably this change makes sense if the parent is the same as the defined specific override, maybe not. Anyways if this is something you're interested the same logic needs to be applied in 2 more files
Well, I don’t want to make decisions. If it works and people like it and it gets tested, then ok for me.
@dgrammatiko You mentioned two more places to be changed. So does it need to keep this issue open, and your PR solves only one part of it? Or is your PR ready and complete and we can close this issue lok. we usually do when having a PR?
You mentioned two more places to be changed.
The layout part is similar for modules/plugins and components, so naturally if one is changed the other 2 need to be adjusted for consistency. The files/methods are:
I think the issue should be closed when either a decision to adapt or not is made from the maintainers. FWIW I think the change asked here is reasonable...
I‘ll ask the team for a decision.
… Or at least for more opinions.
… Or at least for more opinions.
@richard67 Im not on the team, but you wanted opinion, so here you go:
IF template set (in ACP) as default template site-wide doesnt respect its child-overwrites
than clearly its a bug that needs triaging > fixing. Thats it.
Labels |
Added:
bug
|
I experienced a similar bug with a default child template of Atum admin template and com_menus/item/edit.php
But in this case also the control panel/ homepage is opened with the parent Atum template instead of the default child.
Other menus work fine.
How exactly did you did that part? Just by enabling the child as the default template? If so check that ALL the menus are also using the child template as the default. Enabling just a child as default template WILL NOT (by design) assign ALL menus to that template!