switch on childs of a parent node id

Author Message

M M

Monday 14 February 2005 4:09:25 am

Hi all

In the coming code i'm making the condition on the current node which is the parent_node

But i need to do it on the current node when it is the child node to a specific other parent node..

So can anyone please help me??

{let children=fetch('content','list', hash('parent_node_id',$node.node_id )))}

{switch match=$node.node_id}
{case match=64}
here goes the first option
{/case}

{case}
Here goes the second option
{/case}
{/switch}

Thanks in advance

Ɓukasz Serwatka

Wednesday 02 March 2005 12:26:58 am

Hi,

You can fetch parent of current node using {$node.parent_node_id}

For example


{let parentNode=fetch( content, node_id, $node.parent_node_id ) }
    {$parentNode.name}
{/let}

I hope it will help.

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

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 18 2025 20:57:57
Script start
Timing: Jan 18 2025 20:57:57
Module start 'layout'
Timing: Jan 18 2025 20:57:57
Module start 'content'
Timing: Jan 18 2025 20:57:58
Module end 'content'
Timing: Jan 18 2025 20:57:58
Script end

Main resources:

Total runtime0.7473 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0075 588.0313152.6406
Module start 'layout' 0.00750.0034 740.671939.4766
Module start 'content' 0.01100.7348 780.1484527.3906
Module end 'content' 0.74570.0015 1,307.53918.1406
Script end 0.7473  1,315.6797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.4929160.0002
Check MTime0.00160.2131160.0001
Mysql Total
Database connection0.00070.099310.0007
Mysqli_queries0.693692.8160540.0128
Looping result0.00060.0770520.0000
Template Total0.708694.820.3543
Template load0.00230.304820.0011
Template processing0.706494.521120.3532
Template load and register function0.00030.034610.0003
states
state_id_array0.00110.151410.0011
state_identifier_array0.00180.234820.0009
Override
Cache load0.00190.2563240.0001
Sytem overhead
Fetch class attribute can translate value0.00060.075820.0003
Fetch class attribute name0.00130.179730.0004
XML
Image XML parsing0.00060.077620.0003
class_abstraction
Instantiating content class attribute0.00000.001130.0000
General
dbfile0.00080.1055180.0000
String conversion0.00000.001140.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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 13
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs