Gallery ul li

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Brandt
Forum Members
Forum Members
Posts: 55
Joined: Fri Mar 05, 2010 10:04 am

Gallery ul li

Post by Brandt »

Hello beautiful people,

I have a question regarding the Gallery Module. I have the following template:

Code: Select all

<ul>
{assign var='g_prevdepth' value=1}
{foreach from=$images item=image name=img}

{if $image->depth > $g_prevdepth}
{repeat string="<ul>" times=$image->depth-$g_prevdepth}
{elseif $image->depth < $g_prevdepth}
{repeat string="</li></ul>" times=$g_prevdepth-$image->depth}
</li>
{elseif $smarty.foreach.img.index > 0}</li>
{/if}

<li>{$gallerydate}
<a href="{$image->file}" title="{$image->titlename}"><img src="{$image->thumb|escape:'url'|replace:'%2F':'/'|replace:'thumb_':''}" alt="{$image->titlename}" /></a>
<a href="{$image->file}" title="{$image->titlename}">Klik om te lezen</a>
{$image->comment}

{assign var='g_prevdepth' value=$image->depth}
{/foreach}
{repeat string="</li></ul>" times=$image->depth-1}</li>
</ul>
Which prints this structure:

Code: Select all

<ul></ul>
<li><a></a></li>
<li><a></a></li>
But what I would like, offcoarse, is following:

Code: Select all

<ul>
<li><a></a></li>
<li><a></a></li>
</ul>
But I don't understand where it is going wrong in the template code…

Joep
Brandt
Forum Members
Forum Members
Posts: 55
Joined: Fri Mar 05, 2010 10:04 am

Re: Gallery ul li

Post by Brandt »

I did the following which printed the proper structure:

Code: Select all

<ul>
{foreach from=$images item=image name=img}

<li>
{$gallerydate}
<a href="{$image->file}" title="{$image->titlename}"><img src="{$image->thumb|escape:'url'|replace:'%2F':'/'|replace:'thumb_':''}" alt="{$image->titlename}" /></a>
<a href="{$image->file}" title="{$image->titlename}">Klik om te lezen</a>
{$image->comment}
</li>

{assign var='g_prevdepth' value=$image->depth}
{/foreach}
</ul>
As you can see I deleted a bunch of code, this is the part which I understand and it works, but I don't know what I deleted…

Anybody any idea?
Post Reply

Return to “Modules/Add-Ons”