[SOLVED] Gallery: $gallerycomment vs $image->comment
Posted: Sun Aug 10, 2014 5:21 pm
I have a situation where i am trying to access the $gallerycomment of the current (in this case second) $image (which definitely returns true on $image->isdir).
Using $gallerycomment gives the comment of the first gallery in the array of $images. There must be something wrong with the logic in my loop?
Here is the full template:
Using $gallerycomment gives the comment of the first gallery in the array of $images. There must be something wrong with the logic in my loop?
Code: Select all
...
{foreach from=$images item=image}
...
{if $image->isdir}
<a href=... ><img src=... /></a><br />
{$image->titlename} ...<div ...>...{$gallerycomment}...</div>
...
Code: Select all
<div class="pure-u-1-1">
{foreach from=$images item=image}
<div class="img">
{if $image->isdir}
<a href="{$image->file}" title="{$image->file}"><img src="{$image->thumb|escape:'url'|replace:'%2F':'/'}" alt="{$image->titlename }" /></a><br />
{$image->titlename} <a href="#{$image->titlename}" rel="prettyPhoto"><img src="uploads/images/details.jpg" title="Details" alt="Click for details" height="15px" /></a><div id="{$image->titlename}" class="hidden">{$gallerycomment}</div>
{else}
<a class="group" href="{$image->file|escape:'url'|replace:'%2F':'/'}" title="{$image->comment}" rel="prettyPhoto[{$galleryid}]"><img src="{$image->thumb|escape:'url'|replace:'%2F':'/'}" alt="{$image->titlename}" /></a>
{/if}
</div>
{/foreach}
</div>
<div class="galleryclear"> </div>
</div>