-
Notifications
You must be signed in to change notification settings - Fork 9
Modules
Joomlatools Pages has build in support for Joomla modules. Modules no longer need to instantiate and managed through the Joomla Module Manager.
Pages allows to dynamically inject content into any module position, can create modules on the fly and allows to define custom module positions.
You can either create a "virtual" module and inject the content into the position you specify, or you can define a module name (which needs to exist in Joomla) and instantiate the module.
To create a module use the following syntax:
<ktml:module position="[position]">
[content]
</ktml:module>where [position] is the name of the position and [content] is the content to be inserted.
To instantiate an installed Joomla module use the following syntax:
<ktml:module position="[position]" name="[module]">where [position] is the name of the position and [name] is the module name to be created.
To define a module position use the following syntax:
<html:modules position="[position]" condition="[condition]">where [position] is the name of the position and [condition] is an optional condition attribute that defines a more advanced condition as to when the placeholder should be rendered. The modules will not be rendered if there are no position defined.
Only if the condition evaluates to TRUE the modules will be rendered. A condition uses position names and supports following logic operators: + | - | * | / | == | != | <> | < | > | <= | >= | and | or | xor. For example
<html:modules position="sidebar" condition="sidebar >=2 and menu != 0">If you want to wrap the modules inside a html element to apply additional styling you can for example do the following:
<html:modules position="sidebar" condition="sidebar >= 2">
<div class="modules">
<ktml:modules:content>
</div>
</ktml:modules>The <ktml:modules:content>element will be replaced with the modules, and it allows you to wrap the modules with additional html that only be rendered if the sidebar contains at least two modules.
Got a question or need help? We have a forum on Github Discussions where you can get in touch with us.