Forums / General / TreeMenu

TreeMenu

Author Message

Carlos Revillo

Tuesday 20 December 2005 10:26:31 am

hi. i'm working with a custom script now. I'm using ezContentObject and ezContentObjectTreeNode for what i need, but i don't find the solution.

What i want is the "breadcrumb" of a node.
I have

Item 1
Item 1.1
Item 1.1.1
Item 1.1.1.1

and i need get the parents of Item 1.1.1.1 via php script, something like Item 1 - Item 1.1 - Item 1.1.1

Thanks a lot

Gabriel Ambuehl

Tuesday 20 December 2005 10:50:59 am

The default page layout does show breadcrumbs, couldn't you simlpy use that or look at it to see how it's down?

Visit http://triligon.org

Pascal von Büren

Wednesday 21 December 2005 3:09:46 am

Maybe I'm getting you wrong, but you can easily loop over a node's path using following code (as seen in page_toppath.tpl):

{foreach $node.path as $pathItem}
    {$pathItem.name}
{/foreach}

where $pathItem is a fully accessible node element, so you can get whatever information you like (url_alias, attributes, ...)