Finding the 'top but one' node id

Finding the 'top but one' node id

Saturday 12 July 2003 6:23:15 am - 3 replies

Modified on Saturday 12 July 2003 6:25:12 am by Ben Pirt

Author Message

Paulo Almeida

Saturday 12 July 2003 6:44:30 am

If i understand your needs, I seen 2 ways (if anyone have another i'll thanks to seen it too)
You dont know the deep o site, but you know the level of top of your subnavigation. why don't use path too find the top level? something like this:
fetch('content','list',hash(parent_node_id,$module_result.path[2].node_id))

The other ir create an ini file, define there the id of top subnavigation and use ezini in template. or define directly in template (i really don't like this solution).

Hope helped

Paulo Almeida

PACPI.COM Internet Consulting
http://pacpi.com

Ben Pirt

Sunday 13 July 2003 5:06:34 am

i'll try the path version
thanks for your help,
Ben

Ibrahim Khachab

Friday 25 July 2003 4:27:52 am

I think that $node.path_array is an array of the parent nodes ids of the actual node. $node.path_array[0] if the id of root of the site $node.path_array[1] is the id of main folder.

You may use the following code to do what you are asking for.

{section name=parent_path offset=1 loop=$node.path_array}
{let parent_node=fetch('content',node,hash(node_id,$parent_path:item))}
{$parent_path:parent_node.name} >>
{/let}
{/section}

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.