Links from menus

Author Message

Kjell Inge Sandvik

Monday 02 May 2005 9:37:39 am

I have this code:

{let menyitems=fetch(content,list,hash(parent_node_id,2,
                                       class_filter_type,include,
									   class_filter_array,array('folder')))}

{section name=meny loop=$menyitems}
	<a href="{$meny:item.url_alias}">
	{$meny:item.name}
	</a>
	<br />
{/section}
{/let}

This lists all the folders directly below the root (id=2).

How do I construct the urls so that they will show what's inside the folders?

Sandvik Web & Data

M M

Wednesday 04 May 2005 6:43:19 am

Hi
You can do that simply by making a nested loop so that it would display the grand children of the parent node, so i think you would do the following

{let menyitems=fetch(content,list,hash(parent_node_id,2,class_filter_type,include,class_filter_array,array('folder')))}

{*this is the first outside loop*}
{section name=meny loop=$menyitems}
<a href="{$meny:item.url_alias}">
{$meny:item.name}
</a>
<br />

{*this is the second internal loop*}

{section var=meny2 loop=fetch( 'content', 'list', hash('parent_node_id',$meny.node_id))}

{$meny2.name}

{/section}

{*end of second internal loop*}

{/section}

{*end of first outside loop*}

I hope this would help

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:12:32
Script start
Timing: Jan 31 2025 06:12:32
Module start 'layout'
Timing: Jan 31 2025 06:12:32
Module start 'content'
Timing: Jan 31 2025 06:12:33
Module end 'content'
Timing: Jan 31 2025 06:12:33
Script end

Main resources:

Total runtime1.2067 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.0116 588.0313151.1953
Module start 'layout' 0.01170.0044 739.226636.6172
Module start 'content' 0.01611.1898 775.8438918.3438
Module end 'content' 1.20590.0008 1,694.18757.8750
Script end 1.2067  1,702.0625 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.2458160.0002
Check MTime0.00130.1060160.0001
Mysql Total
Database connection0.00080.066110.0008
Mysqli_queries1.149495.2552540.0213
Looping result0.00050.0403520.0000
Template Total1.154595.720.5772
Template load0.00180.149520.0009
Template processing1.152695.521720.5763
Template load and register function0.00170.140010.0017
states
state_id_array0.00210.170710.0021
state_identifier_array0.00200.167320.0010
Override
Cache load0.00140.1181260.0001
Sytem overhead
Fetch class attribute can translate value0.00060.049820.0003
Fetch class attribute name0.00240.199530.0008
XML
Image XML parsing0.00180.153020.0009
class_abstraction
Instantiating content class attribute0.00000.000630.0000
General
dbfile0.00300.2508160.0002
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
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/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: 12
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs