Forums / Setup & design / Show topfolders name in right column.

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Show topfolders name in right column.

Author Message

Valentin Svelland

Monday 14 July 2003 6:23:27 am

I have contentfolders in three levels in my site, and I want visitors to read an output in the right column of which topfolder they're currently at.

Say, the visitors reading an article under /News/Culture/Theater/, I still want the output in the column to read "News" - this being the topfolder. I used to fill in and write out the description-field of the folder, but this is no good solution. This way I can't write out the topfolders name when the visitor is displaying an article either..

Any suggestions?

Claire Lin

Thursday 17 July 2003 12:09:33 am

The attribute
$node.path_array or $node.path contains the info of all the parent nodes down to the current node.
For example, {$node.path[0].name} will show "Root Folder", {$node.path[1].name} will probably be "News" (if your News object is one level under Root Folder).

You can use {$node|attribute(show)} in the template, then you will see the values of $node.path_array or $node.path.

Claire

Valentin Svelland

Thursday 17 July 2003 1:34:47 am

Thanks Claire!
I'm sure this is the solution. As you say {$node.path[0].name} shows the root folders name, and {$node.path[1].name} my level "MySite".

However {$node.path[2].name} doesn't return "News", "Sports" and so on. No output, just a blank line. weird.. Trying to figure out why. The names exist so I can't understand why [2] doesn't return "News" as in my structure / Root Folder / MySite / News..

Ok, I found this error in debug:
----------------------------------
Error: eZTemplate @

design/mysite/override/templates/pagelayout_mysite.tpl:330[24] Jul 17 2003 10:50:33
No such attribute for array(2): 3
Choose one of following: 0, 1