Forums / Setup & design / Show section if fetch not empty

Show section if fetch not empty

Author Message

Benjamin Selmer

Wednesday 02 November 2005 1:12:30 am

I want to display some text if the events object is not nempty. What should i use after section show= ?

Can anyone help?

events=fetch( 'content', 'list', hash( 'parent_node_id', 144, 'attribute_filter', array( 'and', array( 'event/date_from', '<=', $temp_ts), array( 'event/date_to', '>=', $temp_ts ))))

Listing the content of $events is not a problem. But I want to display a header above the list.

Ɓukasz Serwatka

Wednesday 02 November 2005 1:15:37 am

Code example.

{section show=$events}
   {*Add here new section with loop*}
{section-else}
    <h1>List is empty.</h1>
{/section}

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Benjamin Selmer

Wednesday 02 November 2005 1:40:34 am

Thanks!