Efficient changing of {section} output

Efficient changing of {section} output

Thursday 24 July 2003 1:17:16 am - 2 replies

Author Message

Jan Borsodi

Thursday 24 July 2003 1:26:00 am

You could use one 'section' to loop trough the items and then another one to check for that specific first item.
{section loop=$new_cats}
<h3><a...></a></h3>
{section show=eq($:index,0)}
<div>...</div>
{/section}
{/section}

'index' is a variable generated by the section when it loops, it start at 0 and increases as each item is processed.
A 'number' variable is also available which starts at 1 and increases.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Tristan Koen

Friday 25 July 2003 12:29:59 am

Ah! Thanks. Thats exactly what I was looking for. In my initial attempts I was trying
{section show=eq($news_cats.1,0)}
...
{/section}
which didn't work at all. I have to assume that the fetch('content',line,hash(....)) function doesn't return an array then? Any clarification you can give me on this point would be appreciated.

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.