Why won't this snippet work?

Author Message

Valentin Svelland

Tuesday 15 July 2003 3:31:04 am

Is there a conflict due to nesting {let}s or something? Can't get inner {section} to output :

----------------------

{* Teller antall artikler i gjeldende folder *}
{let noOfArticles=fetch('content','list_count', hash('parent_node_id',$node.node_id,'class_filter_array',array(2),'class_filter_type','include'))}

{* Sjekker om det er flere en x antall artikler og lister overskytende *}
{switch name=listesjekk match=$noOfArticles}
{case match>=3}

<img src={"spacer_grey.gif"|ezimage} width="470" height="1" /><br />
<h3>Flere saker</h3>

{let article_list=fetch('content','list', hash(parent_node_id,$node.node_id,
sort_by,$node.sort_array,
offset, $view_parameters.offset,
class_filter_type, 'include',
class_filter_array, array( 2 ) ))
}
{section name=bottomlist loop=$article_list max=50 offset=1}
<p class="readmore"><a href={concat("/content/view/full/", $bottomlist:item.node_id, "/")|ezurl}>{$bottomlist:item.name|wash}</a></p>
{/section}
{/let}


{/case}
{/switch}
{/let}

Jan Borsodi

Tuesday 15 July 2003 3:40:21 am

The problem is most likely this line
{case match>=3}
Template functions does support operator handling for their parameters, secondly all template functions are 100% generic which means that switch/case is not a builtin template operation.

You can solve this by using the section function and some operators.
{section show=$noOfArticles|ge(3)}
...
{/section}

--
Amos

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

Valentin Svelland

Tuesday 15 July 2003 4:58:15 am

Thanks Jan, that worked out fine!

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 31 2025 01:28:52
Script start
Timing: Jan 31 2025 01:28:52
Module start 'layout'
Timing: Jan 31 2025 01:28:52
Module start 'content'
Timing: Jan 31 2025 01:28:53
Module end 'content'
Timing: Jan 31 2025 01:28:53
Script end

Main resources:

Total runtime0.9120 sec
Peak memory usage8,192.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0043 588.1328151.2109
Module start 'layout' 0.00430.0039 739.3438220.6875
Module start 'content' 0.00820.9028 960.03134,454.7578
Module end 'content' 0.91110.0009 5,414.789111.8516
Script end 0.9120  5,426.6406 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.3819160.0002
Check MTime0.00130.1394160.0001
Mysql Total
Database connection0.00070.074710.0007
Mysqli_queries0.824790.4308570.0145
Looping result0.00060.0604550.0000
Template Total0.865594.920.4327
Template load0.00190.206620.0009
Template processing0.863694.688620.4318
Template load and register function0.00110.126110.0011
states
state_id_array0.00080.091810.0008
state_identifier_array0.00140.148720.0007
Override
Cache load0.00150.1686390.0000
Sytem overhead
Fetch class attribute can translate value0.00170.190620.0009
Fetch class attribute name0.00190.212250.0004
XML
Image XML parsing0.00210.231120.0011
class_abstraction
Instantiating content class attribute0.00000.001160.0000
General
dbfile0.00240.2593230.0001
String conversion0.00000.000940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
7content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs