Gallery module - custom param.

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
przemo
Forum Members
Forum Members
Posts: 23
Joined: Mon Dec 30, 2013 12:58 pm

Gallery module - custom param.

Post 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?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Gallery module - custom param.

Post 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}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: Gallery module - custom param.

Post by Rolf »

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
przemo
Forum Members
Forum Members
Posts: 23
Joined: Mon Dec 30, 2013 12:58 pm

Re: Gallery module - custom param.

Post by przemo »

Thanks to you guys, this is not my perfect solution but better than none such. The solution proposed by calguy1000 works fine.
Post Reply

Return to “Modules/Add-Ons”