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

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

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!