[ENHANCEMENT]: Standard module does not have a modulelayout field #1248
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Enhancement Details
There is currently no option for selecting a template. I understand that JCB only creates a single view and so a selector isn't needed. The only problem is when we install a module on different sites with different templates we need 2 different versions since we can't make an override and select it. The "modulelayout" field does exactly what i want, which only needs a little styling (which i could do if that would quicken adding it).
Which part of the extension will be affected by this enhancement?
Compilation of component, Joomla Modules(admin_views), Joomla Module(admin_view)
Additional Context
After compiling a module, you cannot select different layout in the module. A usecase for why i'm asking for this to be added:
We have a form component where we have a custom form builder for a client. They need some specific logic that is difficult to add with regular form components like chronoforms or rsforms. Currently the client has 2 sites, with different versions of Joomla, and different templates. One uses bootstrap and the other using UIKit. This has no clean solution since we either need 2 modules (creates issues with having to update 2 versions) or we have 1 view with 2 complete views in it, 1 for each template. Apart from this single client we want to implement our form builder on other sites since we're moving away from standard form generators since they often create issues with upgrading Joomla versions. An issue JCB neatly solves!
This sounds like a great idea... give me a module. Basic one, that has this feature coded into it, and I will see what we can do.
The module mod_login uses the modulelayout field.
In the xml:
The 'old' J3 modules that come with base joomla still calls the layout like this:
While the mod_custom uses the dispatcher, which funny enough still ends up calling the same logic:
require ModuleHelper::getLayoutPath($module->module, $params->get('layout', 'default'));
This is done in libraries/src/Dispatcher/AbstractModuleDispatcher.php