Now we will see how you can further control the module by adding extra parameters to the {module}
tag.
The syntax of these parameters looks like name="value"
, which you might recognise from how html works.
{module title="Title of my module" style="none"}
{module id="123" style="none"}
{module id="64:This is the login form" style="none"}
Show or Hide Title
You can easily decide whether to show or not show the module title with a showtitle
parameter set to either true
or false
.
{module title="Some module" showtitle="false"}
HTML styles
You can easily place the module (or module position) with another style than the one you have set as default (default is none
). Just add the style
parameter:
{module title="Main Menu" style="well"}
{modulepos position="position-7" style="well"}
The HTML styles (chrome) you can use depend on your Joomla version and template.
Joomla 3 comes with the HTML styles none
, horz
, html5
, outline
, rounded
, table
, and xhtml
.
The Joomla 3 template Protostar comes with the extra HTML style well
.
The Joomla 3 template Beez comes with the extra HTML styles division
and tabs
.
Joomla 4 comes with the HTML styles none
, html5
, outline
, and table
.
The Joomla 4 template Cassiopeia comes with the extra HTML styles card
and noCard
.
Alternative Layout PRO
If you created a different layout for a specific module type (to be placed inside templates/[my template]/html/mod_[type of the module]/
), you can assign it to your module in the tag with a layout="..."
attribute:
{module title="Main Menu" layout="my-alt-layout"}
You can also use the layout from a different template, by specifying the template where it resides with the format template-name:layout-name
:
{module title="Main Menu" layout="protostar:my-alt-layout"}
Other parameters PRO
You can also overrule the other module parameters, so that you can have a module displayed in different ways, with different settings just by overruling the settings via the tag.
You can overrule any parameters you can find in the module edit screen (in the administrator).
{module title="Main Menu" moduleclass_sfx="red" some_other_setting="123"}
So for example, you could change the number of displayed items in a listing module with something like:
{module title="Latest News" count="10"}
To find the name of the field you want to change, you can look in the html output of the module edit page. Look for the id of the parameter field. This is the part in the brackets in the field name after [params]: jform[params][xxx]
.
Fixing HTML output
Modules Anywhere will - by default - try to fix issues in the html output of the module (including the surrounding html tags).
It does this to prevent html structure issues potentially caused by the html of the module being placed inside whatever html the {module} tag is placed in.
For instance, if the {module}
tag is inside a paragraph (<p>
tag) and the module outputs a <div>
structure, you get a <div>
tag inside a <p>
tag.
That is invalid html and Modules Anywhere will fix that. In this case by removing the surrounding <p>
tags.
There are however some modules that output invalid html structures out-of-the-box and rely on that faulty structure to function. When Modules Anywhere 'fixes' that html, the module will stop working.
For these edge cases you want Modules Anywhere to leave the html alone and simply output it.
You can do this by either switching off the Fix HTML
option in the Modules Anywhere system plugin settings, or by switching this off via the {module}
tag:
{module title="Name of the Module" fixhtml="false"}