Page 1 of 1

Gallery module - custom param.

Posted: Mon Dec 30, 2013 1:19 pm
by przemo
Hi,
I would like to bring to such a situation, so I can decide which side will display the image (float:left or float:right).

My template code (for single image):
<a class="single" style="float:XXX" href="{$image->file|escape:'url'|replace:'%2F':'/'}" title="{$image->title}" rel="prettyPhoto"><img src="{$image->thumb|escape:'url'|replace:'%2F':'/'}" alt="{$image->title}" /></a>

Into the content I put:
{Gallery dir='Gallery' img="64" XXX="left"}

Of course it dosen't work - I was missing something, but I do not know what. If anyone can help?

Re: Gallery module - custom param.

Posted: Mon Dec 30, 2013 5:33 pm
by calguy1000
You can't call a module with custom parameters like that. it's designed to discard whatever it doesn't understand.

However, you can set a variable into smarty, and then call the module, and use your custom variable inside the module's templates.

i.e:

Code: Select all

{$mycustomvar=1}
{Gallery dir=Gallery img=64}
.... then in your gallery template you can use that variable.

Code: Select all

{if isset($mycustomvar) && $mycustomvar == 1}
   {* do something *}
{else}
   {* do something else *}
{/if}

Re: Gallery module - custom param.

Posted: Mon Dec 30, 2013 5:40 pm
by Rolf

Re: Gallery module - custom param.

Posted: Tue Dec 31, 2013 7:40 am
by przemo
Thanks to you guys, this is not my perfect solution but better than none such. The solution proposed by calguy1000 works fine.