Any change to run smarty tag in Listit's field?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Recon
Forum Members
Forum Members
Posts: 200
Joined: Sat Oct 09, 2010 10:23 am

Any change to run smarty tag in Listit's field?

Post by Recon »

Hi,

Trying to show specific gallery module's folder via ListIt. Customer adds new items to ListIt where is text-fields and images. One text-field is for gallery module's tag like {Gallery dir='houses'}. This will not show gallery on the listIt's frontEnd, what I wanted to show.

Any other way to do this? Customer should be able to load specific gallery folder to listit2 "output" ?


br

-R
Stikki

Re: Any change to run smarty tag in Listit's field?

Post by Stikki »

Install ListItExtended Xdefs (ListIt2XDefs).

Use Gallery dropdown to gain correct gallery dir directly from Gallery module to your item.

Let's say your gallery fields alias is: gallery

Then use gallery tag in ListItExtended templates something like this:

{Gallery dir=$item->gallery}

Should do the trick

-Stikki-
User avatar
timdebuurman
Power Poster
Power Poster
Posts: 891
Joined: Sun Nov 06, 2011 8:15 pm

Re: Any change to run smarty tag in Listit's field?

Post by timdebuurman »

Hi,

It works.

If none of the galleries is chosen, I don't want to show the gallery at all.
Now if I don't choose one, the gallery dir is showing.

I solved it for now, by removing the content in the gallery template between:
{if $image->isdir}
and
{else}

That shows noting in front, but in the code there is still the rest:
<div class= "gallery"> ... etc.

What I need is a simple {if}-statement to only show the gallery if a item is chosen.

grt Tim
NextDoorMedia - Online Marketing Partner
https://www.nextdoormedia.nl
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Any change to run smarty tag in Listit's field?

Post by Dr.CSS »

I use this to hide empty content, maybe adapt it to your code...

{content block='newsblock' assign='test'}
{if !empty($test)}
<div class="content">
{$test}
</div>
{/if}
User avatar
timdebuurman
Power Poster
Power Poster
Posts: 891
Joined: Sun Nov 06, 2011 8:15 pm

Re: Any change to run smarty tag in Listit's field?

Post by timdebuurman »

Problem is that the content is not empty..

There is still the gallery template
NextDoorMedia - Online Marketing Partner
https://www.nextdoormedia.nl
uniqu3

Re: Any change to run smarty tag in Listit's field?

Post by uniqu3 »

In your ListIt2 template

Code: Select all

{if $item->YOUR_GALLERY_FIELD_ALIAS != ''}
    {Gallery dir=$item->YOUR_GALLERY_FIELD_ALIAS}
{/if}
   
Post Reply

Return to “Modules/Add-Ons”