I’m new to joomla and T4.
I was trying a few things with the quickstart T4 for joomla 5 and I stumbled on something that seems like a problem. Did the following:
On the backend:
- in TEST-J5-T4\templates\t4_bs5_blank\local\etc\layout I have created a new file, my-default-magz.json, a copy of home-magz.json from TEST-J5-T4\templates\t4_bs5_blank\etc\layout
- duplicated the t4-bs5-blank-Default template style as myDefault and set my-default-magz as its Main Layout
- set myDefault as default template style
On the frontend, I opened the Blog List Layout page which, in the menu item, has as template style „Use Default”. Now the modules „IT Procurement”, „Mobile” and „Technology” appear above the list blog page, as per the new default template style, myDefault, where these modules are assigned to the section-2 position of the my-default-magz layout, above the component and sidebar position. That is as expected.
But when I try to open articles from the page, they are inconsistent.
The ones from the new modules use the default layout:
<body class="site-home-magz navigation-default theme-default layout-default nav-breakpoint-lg oc-desktop com_content view-article item-180 loaded-bs5 home-magz item-list" data-jver="5">
Which is unexpected because the main layout of the default template style is now my-default-magz. The default.json file should not be in use.
The articles from the original Blog List Layout page, regardless whether they come from the component list or the module on the sidebar, when opened, use the my-default-magz layout:
<body class="site-default navigation-default theme-default layout-my-default-magz nav-breakpoint-lg oc-desktop com_content view-article item-179 loaded-bs5" data-jver="5">
To further investigate I created a my-page-magz.json with the same content as home-magz.json and a myPage template style where I set my-page-magz as Main Layout. I use this as template style for the Blog List Layout page.
Now, when I open the articles from the modules newly added to the page, they behave the same, the layout is from the default.json file, which should not be in use. But when I open the articles from the original Blog List Layout, both component and sidebar module, their layout is not the default my-default-magz any more. It’s the my-page-magz layout:
<body class="site-default navigation-default theme-default layout-my-page-magz nav-breakpoint-lg oc-desktop com_content view-article item-179 loaded-bs5" data-jver="5">
So previously it only seemed that the component and sidebar module where functioning correctly.
In short, it seems that after changing the main layout of a template style, the articles from that page, when opened, would use either a hard coded default layout which may or may not be the actual layout of the actual default template style, or the main layout of the template style of the originating page.
To me, this is a very serious limitation. It makes the use of custom layouts for template styles impossible.
What can be done?