Via Parameter, the Joomla module can be flexibly adapted for end users. Parameters are variables through which Joomla is set to process certain values. In other words, parameters are influencing factors set externally to the programme. They are used to tell the module externally which data should be processed and how.

For impatient people: Look at the changed programme code in the Diff View[^] and copy these changes into your development version.

Step by step

New files

In this section we add parameters to the module.

New files

In this part, only files have been changed. There are no new files.

Changed files



The labelling of the parameter in the backend should adapt to the active language. For this reason we use the language file.

Are you wondering about the prefix COM_ in COM_MODULES_FOOPARAMS_FIELDSET_LABEL? The language string is automatically created by Joomla because a fieldset called fooparams is added.

modules/mod_foo/ language/en-GB/mod_foo.ini


In the manifest we add the new parameter so that it is editable in the Joomla backend.

modules/mod_foo/ mod_foo.xml

		<fields name="params">
			<fieldset name="fooparams">

Use <fieldset name="basic"> to display the parameters in the first tab that opens immediately.

In addition to the parameters that a developer inserts into his module, there are standard parameters that Joomla handles itself. For example /administrator/components/com_modules/forms/advanced.xml.

Joomla Module Parameters


In the module's own template file, we can now access the value of the parameter. In the following example, we output the value as text. Usually a parameter is used in a more complex way, for example within control structures such as if-statements or loops.

An example of the more complex use of a parameter is a digital map where parameters are used to enable controls such as locate me or a choice of map type.


 \defined('_JEXEC') or die;

echo '[PROJECT_NAME]' . $test;
echo '[PROJECT_NAME]' . $test . '<br />' . $url;

The Dispatcher collects the variables that we can use later in the module layout tmpl/default.php. Here we see add the parameter.

         $data = parent::getLayoutData();
       $data['text'] = $this->getHelperFactory()->getHelper('FooHelper')->getText();
       $data['text'] = $this->getHelperFactory()->getHelper('FooHelper')->getText($data['params']);
         return $data;
 namespace FooNamespace\Module\Foo\Site\Helper;
use Joomla\Registry\Registry;

 \defined('_JEXEC') or die;
      public function getText()
      public function getText(Registry $params)
              return ' FooHelpertest';
              $url = $params->get('domain', '-');

              return ' FooHelpertest: ' . $url;

Test your Joomla module

  1. install the module in Joomla version 4 to test it:

Copy the files in the modules folder into the modules folder of your Joomla 4 installation.

A new installation is not necessary. Continue using the files from the previous part.

  1. Check the presence of the parameter in the backend.

Test Joomla Module

  1. make sure that the value of the parameter is taken into account in the frontend display.

Test Joomla Module

Joomla Dokumentation[^]