What I want is this:
Code: Select all
<div class="category">
<h3>[category heading]</h3>
<ul>
<li>[category item]</li>
<li>[category item]</li>
…
</ul>
</div>
<div class="category">
…
</div>
<div class="category">
…
</div>
… etc. …
Now, my template looks like this:
Code: Select all
<div class="praesidium">
{foreach from=$categories item=category}
{if $category->depth == 1}
{if $category->prevdepth > 1}
</ul>
</div>
{/if}
{if !count($category->items)}
{continue}
{/if}
<div class="category {$category->alias}">
<h3>{$category->menutext}</h3>
<ul>
{else}
<li>{$category->menutext|cms_escape}, {$category->depth}</li>
{/if}
{/foreach}
</ul>
</div>
</div>
Code: Select all
{if $category->prevdepth > 1}
</ul>
</div>
{/if}
If I remove the ones after the loop then the last item isn’t closed properly (if it’s not empty).
I can’t figure this out. What’s the solution to this dilemma?



