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
[4.2.5] Inheritance of template and template child overrides #39306
Comments
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! |
|
I just enabled the child template and was expecting that all the overrides in the child template would work. |
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. |
@StefanSTS This is not how it works. Your expectation is wrong. |
|
Maybe the system is too limited. |
|
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. |
|
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. |
Yes, I thought it would magically use In the same way as it magically changes when I make an override in Cassiopeia for mod_login/default.php.
It might look like it is the expected behaviour, but it's not consistent compared to the behaviour of default.php.
I send this now and read it again to understand myself. |
|
Tested another theory: 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? |
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. |
|
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. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39306. |
Steps to reproduce the issue
How I got to the issue:
Expected result
The override for mod_menu should work like given in the child template.
Actual result
The override of the child template is not working.
You have to explicitely choose the child template override in the module.
System information (as much as possible)
PHP 8.0.x but doesn't matter I guess
J 4.2.5
Additional comments
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.
The text was updated successfully, but these errors were encountered: