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!

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

eZ debug

Timing: Jan 19 2025 01:07:52
Script start
Timing: Jan 19 2025 01:07:52
Module start 'layout'
Timing: Jan 19 2025 01:07:52
Module start 'content'
Timing: Jan 19 2025 01:07:52
Module end 'content'
Timing: Jan 19 2025 01:07:52
Script end

Main resources:

Total runtime0.0199 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 590.2734152.6250
Module start 'layout' 0.00630.0038 742.898439.4609
Module start 'content' 0.01010.0073 782.359489.3516
Module end 'content' 0.01740.0025 871.710934.3047
Script end 0.0199  906.0156 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002914.7030140.0002
Check MTime0.00157.5387140.0001
Mysql Total
Database connection0.00084.048610.0008
Mysqli_queries0.004020.237130.0013
Looping result0.00000.084910.0000
Template Total0.002010.110.0020
Template load0.00136.294810.0013
Template processing0.00083.817810.0008
Override
Cache load0.00062.849010.0006
General
dbfile0.002311.433080.0003
String conversion0.00000.049040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs