Page 1 of 1

[Solved] Passing a string to a module template

Posted: Fri Jan 17, 2014 5:58 am
by Cerulean
For modules that have their own template system (e.g. News, ListIt2, Gallery), is it possible to pass a string from my page template to the module so that it is available in the module template? I'm imagining something like a custom parameter for the module when it is called in the page template.

Using Gallery as an example...

Code: Select all

{Gallery my_custom_width="200"}
...so that in my Gallery template I can do this...

Code: Select all

{foreach from=$images item=image}
<img src="{$image->file}" width="{$my_custom_width}">
{/foreach}
Of course I tried this to check it and it seems like custom parameters in module tags generate an error. Is there another way?

Re: Passing a string to a module template

Posted: Fri Jan 17, 2014 6:11 am
by Rolf

[Solved] Re: Passing a string to a module template

Posted: Fri Jan 17, 2014 6:36 am
by Cerulean
Thanks, works great.