Skip to content
Johan Janssens edited this page Jun 9, 2019 · 29 revisions

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.

Table of Contents

Injecting in a module position

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.

Creating a 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.

Instantiating a module

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.

Defining module positions

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. Only if the condition evaluates to TRUE the modules will be rendered.

Using conditions

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">

Wrapping modules

If you want to wrap the modules inside a html element to apply additional styling you can for example do the following:

<khtml: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.

Clone this wiki locally