How can i effectively add a custom parameter for the function {loadmodule mod_name}
. Something like:
{loadmodule mod_video_player src="0Bmhjf0rKe8" start="5" end="20"}
Any ideas? Thanks!
Joomla Stack Exchange is a question and answer site for Joomla! administrators, users, developers and designers. It only takes a minute to sign up.
Sign up to join this communityDon't use loadmodule
actually. You have to make your own plugin based on it.
Copy the loadmodule plugin from plugins/content/loadmodule
to another folder (probably plugins/content/video_player
based on your question). We will use it as a base, but change how it loads things.
I would then trigger the module with code like the following:
{video_player src="0Bmhjf0rKe8" start="5" end="20"}
You would then need to adjust the regex (and remove one, since you only have one trigger) to be like so:
// Expression to search for(modules)
$regexmod = '/{video_player\s(.*?)}/i';
$stylemod = $this->params->def('style', 'none');
Finally, you would need to adjust all of the processing (and this part is on you to try) so that it processes the matching string (which will be all your settings) and returns a video player with those settings, like how the current plugin returns the loaded module.
You can either actually load the module and pass it settings or place the code for the video player in the plugin.
If you are not a developer to make your own plugin then its best to use nonumber, really simplifies things like this.
http://www.nonumber.nl/extensions/modulesanywhere/userguide
It is a pro only feature but it allows you to adjust settings.