0

I commonly assign modules to template position none. In my index.php template, such a position doesn't exist - so the modules don't show. On the pages, I want them to show I use: {loadmoduleid 100}.

Is there a performance impact on displaying modules on every page? Or should I only set it to only the specific pages it appears on? I'm using advanced module manager.

1 Answer 1

2

There is no simple answer to this as exact performance would depend on a number of factors, including number of modules, menu items and installed plugins. The important thing to understand is that modules are not executed until actually needed. I.e. if module is assigned to a position not present in the template, it will not be rendered. So there is at least no major performance impact. Plugins that heavily process modules during onAfterModuleList event could affect performance though.

There is also a trade off when using menu assignments. This is because for every menu item assigned/unassigned a database entry is made in #__modules_menu table. This could affect performance when loading the initial module list. And when using "On all pages except those selected" assignment mode, plugins with onAfterModuleList could be greatly affected since the module list contains duplicate instances of the same module, one for each menu item unassigned.

2
  • If I understand you correctly, it won't be rendered if the module position is not in the template index.php, just the template.xml. Right?
    – iamrobert
    Commented May 12, 2022 at 8:35
  • 1
    Positions in templateDetails.xml have no impact here, they're only used in module editing form. Positions need to be present in the template file (e.g. index.php). Or rendered manually like by using the plugin.
    – Sharky
    Commented May 13, 2022 at 7:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.