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]}.

plg_loadmoduleparams

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.

Links

Edit Me on GitHub Here

You can download this here: Content – Load Module with Params

Add Comment Register



Leave a Reply

Your email address will not be published. Required fields are marked *

ERROR: si-captcha.php plugin says GD image support not detected in PHP!

Contact your web host and ask them why GD image support is not enabled for PHP.

ERROR: si-captcha.php plugin says imagepng function not detected in PHP!

Contact your web host and ask them why imagepng function is not enabled for PHP.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>