Extract Info from eZ

Author Message

Softriva .com

Wednesday 16 August 2006 12:29:02 am

Under node #2, there are three folders A, B, C and under each folder there are 5 folders i.e. A1, A2,....A5, B1, B2.....B5, etc.

How can I extract these folders and display them as

A
A1, A2, A3, A5, A5

B
B1, B2, B3, B4, B5

C
C1, C2, C3, C4, C5

I have start as follows:

{def $wa_node=fetch(content,list, hash(parent_node_id, 2))}

{foreach $wa_node as $menu}
{node_view_gui view=line content_node=$menu}
{/foreach}

{undef}

The above only print A, B, C

Clemens T

Wednesday 16 August 2006 1:31:29 am

Heeya Oozy,

Here's a summary of all kinds of fetch functions in eZ (for content that is).

http://ez.no/doc/ez_publish/technical_manual/3_8/reference/modules/content/fetch_functions

And the $wa_node is not even needed, here's my solution to your problem (it needs some work, but you get that the fetch content TREE does the trick, check the manual.. for more info):

{foreach fetch(content,tree, hash(parent_node_id, 2,
                                   depth, 2)) as $menu}
{node_view_gui view=line content_node=$menu}
{/foreach}

Have fun,
Clemens

Coulibaly Ibrahim

Wednesday 16 August 2006 1:55:37 am

if you want to undestand how it works

{def $wa_node=fetch(content,list, hash(parent_node_id, 2,
                                                                   class_filter_type, 'include', 
                                                                   class_filter_array, array('folder')))}

{foreach $wa_node as $menu}
<br />
{node_view_gui view=line content_node=$subFolder}{*print A, B, C....*}
    {def $subFolders=fetch(content,list, hash(parent_node_id,$menu.node_id,
                                                                   class_filter_type, 'include', 
                                                                   class_filter_array,array('folder')))
    }
    {foreach $subFolders as $subFolder}
              {node_view_gui view=line content_node=$subFolder} {*print A1,...A5, B1... B5..*}
    {/foreach}
    {undef $subFolders}
{/foreach}

{undef}

Hope it can help you ;)

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 06:24:02
Script start
Timing: Jan 31 2025 06:24:02
Module start 'layout'
Timing: Jan 31 2025 06:24:02
Module start 'content'
Timing: Jan 31 2025 06:24:03
Module end 'content'
Timing: Jan 31 2025 06:24:03
Script end

Main resources:

Total runtime0.8522 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0044 588.1250151.2109
Module start 'layout' 0.00450.0026 739.335936.6484
Module start 'content' 0.00710.8442 775.9844932.7734
Module end 'content' 0.85120.0009 1,708.757811.8594
Script end 0.8521  1,720.6172 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.3520160.0002
Check MTime0.00130.1523160.0001
Mysql Total
Database connection0.00070.086410.0007
Mysqli_queries0.803794.3129590.0136
Looping result0.00050.0628570.0000
Template Total0.824796.820.4124
Template load0.00220.255420.0011
Template processing0.822596.522420.4113
Template load and register function0.00140.163010.0014
states
state_id_array0.00100.121010.0010
state_identifier_array0.00160.193420.0008
Override
Cache load0.00180.2160300.0001
Sytem overhead
Fetch class attribute can translate value0.00060.067530.0002
Fetch class attribute name0.00190.222230.0006
XML
Image XML parsing0.00030.037430.0001
class_abstraction
Instantiating content class attribute0.00000.000830.0000
General
dbfile0.00140.1689100.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/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
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/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: 21
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs