Forums / Developer / How to set the 'show' parameter for the 'section' function?

How to set the 'show' parameter for the 'section' function?

Author Message

Iris Hoekstra - Roscam Abbing

Thursday 01 April 2004 2:19:30 am

Hi there,

I am trying to write some code which is only executed if a certain condition is met.

I do this:
{section show=$DesignKeys:used.class|eq(1)}
conditional code goes here
{section-else}
do nothing
{/section

I also print out $DesignKeys:used.class to the screen, and there I can see that it is in fact 13. But the conditional code is still executed. What am I doing wrong?

Paul Forsyth

Thursday 01 April 2004 3:45:34 am

Try:

{section show=eq($DesignKeys:used.class,1)}
conditional code goes here
{section-else}
do nothing
{/section}

paul

eZ debug

Timing: Jan 31 2025 04:15:30
Script start
Timing: Jan 31 2025 04:15:30
Module start 'content'
Timing: Jan 31 2025 04:15:30
Module end 'content'
Timing: Jan 31 2025 04:15:30
Script end

Main resources:

Total runtime0.0200 sec
Peak memory usage2,048.0000 KB
Database Queries4

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 588.1563180.8125
Module start 'content' 0.00570.0066 768.968893.9766
Module end 'content' 0.01230.0075 862.945370.7031
Script end 0.0199  933.6484 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00209.9709120.0002
Check MTime0.00094.6312120.0001
Mysql Total
Database connection0.00063.196610.0006
Mysqli_queries0.002311.658740.0006
Looping result0.00000.141020.0000
Template Total0.007236.210.0072
Template load0.00073.742510.0007
Template processing0.006532.466510.0065
Override
Cache load0.00052.721210.0005
General
dbfile0.005326.3062100.0005
String conversion0.00000.026330.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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