Content – Load Module with Params

This is a very simple Core Enhancement that allows parameters to be sent to dynamic module inclusions.

Description

Embed and Load a Module in an article, with parameters. For those who are developing custom modules or those who need to send custom variables to a module include, this Plugin will effectively use a query string next to your module to include and then attach the parameters to the Rendered object, overwriting default settings and adding additional parameters that can be dynamically interpreted by the selected Module.

How to Use

Simply add the syntax to any article. Syntax would be {pmod [module_name|queryParams]}, for instance {pmod [module_name|content_id=45398534&type=Normal]}.

If you are creating a custom module, you can read the custom parameters using the $params->get() or $params->getValue() functions.

$test = $params->get(‘test’);

Also, there is a default value that is sent when included, which is “moduleinclude”

$moduleinclude = $params->get(‘moduleinclude’);

If ‘moduleinclude’ is set to true, it means that the module was activated by a custom inclusion.