Is it possible to pass a variable to a gallery template ?
E.g,
on the page template put
{gallery dir="pics1" myvar="1"}
{gallery dir="pics1" myvar="2"}
{gallery dir="pics1" myvar="3"}
Then in the gallery template
{if $myvar eq "1" }
....
{/if}
{if $myvar eq "2" }
....
{/if}
I know I can define a smarty var per page in admin Page Options .
[solved] Gallery passing smarty var down to gallery template
[solved] Gallery passing smarty var down to gallery template
Last edited by booo9 on Thu Feb 21, 2013 11:13 pm, edited 1 time in total.
Re: Gallery - passing smarty var down to gallery template
It should work to define the variable just before the Gallery tag
{$myvar=1}
{Gallery dir='pics1'}
Then in the Gallery template:
{$myvar=1}
{Gallery dir='pics1'}
Then in the Gallery template:
Code: Select all
{if $myvar eq "1" }
....
{/if}
{if $myvar eq "2" }
....
{/if}
Re: Gallery - passing smarty var down to gallery template
that does it indeed,
thank you Jos
thank you Jos