[SOLVED] Get Gallery field definition
Posted: Fri Jun 06, 2014 12:57 pm
Hello, I've created a Field Definition (a checkbox with alias=pubblic_in_home_page) for the subgalleries, but I can't get its value in Gallery template.
I want to use the checkbox to show only checked sub-galleries in Home Page.
My gallery structure:
I call the module in this way:
In Gallerytree template, I'm using this Smarty code (suggested by Velden: http://forum.cmsmadesimple.org/viewtopi ... 93#p312793) to load Gallery images in the slideshow:
I've added:
before the above foreach loop, but I can't get the field.
Any ideas?
Thank you
I want to use the checkbox to show only checked sub-galleries in Home Page.
My gallery structure:
Code: Select all
- Gare
- - First
- - Second
- - etc.
Code: Select all
{Gallery dir="Gare" template="gallerytree2"}
Code: Select all
{foreach from=$images item=image name=img}
<div class="{if $smarty.foreach.img.index > 0}hide{else}item backcolrhover{foreach from=$fields item=f key=fieldalias}{if $f.value} {$fieldalias}{/if}{/foreach}{/if}">
<a class="fancybox" rel="gallery{$galleryid}" href="{root_url}/{$image->file}" title="">
<div style="display:none" class="galtitle">
{$image->title}<br />{$gallerycomment}
</div>
<div class="hoverlinks">
<img src="/images/magcircle.png" class="mag" title="apri">
</div>
{if $smarty.foreach.img.index == 0}
<img src="{root_url}/{$image->thumb|escape:'url'|replace:'%2F':'/'}" alt="" />
{/if}
</a>
{if $smarty.foreach.img.index == 0}
<div class="caption">
{$gallerytitle}
</div>
{/if}
</div>
{*assign var='g_prevdepth' value=$image->depth*}
{/foreach}
Code: Select all
{if $fields.pubblic_in_home_page.value eq '1'}pubblic_in_home_page is ONE
{else}pubblic_in_home_page is ZERO{/if}
Any ideas?
Thank you