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.