create top tab strip / nav bar which changes with dir location?

Author Message

Michael M

Saturday 03 January 2004 10:15:16 pm

How can I create a tab strip like the one used at http://ez.no where the subsection of the website I'm in is highlighted in the top strip. Or like the tab strip in the admin menus?

(I'm sure this is a common question but I can't find it in the docs, sorry!)

Marco Zinn

Sunday 04 January 2004 7:10:08 am

Usually, this is done by checking the current node_id and the path.
As you will usually do this in the pagelayout template, see here http://ez.no/developer/ez_publish_3/documentation/customization/custom_design/template_variables_set_by_ezpublish for more info on the template variables. You will most likely need $module_result.path.
Now, if your node tree structure is the same as your website structure, the items in the tab bar usually are "at the same level" in the node tree.

Pseudo-Code, if you want a tab based on level 2 nodes:
set $branch=$module_result.path[2]
switch match=$branch
case "NODE_ID_BRANCH_1": print tab bar for nodes in branch 1 (maybe including mouseover-grafics)
case "NODE_ID_BRANCH_2": print tab bar for nodes in branch 2 (maybe including mouseover-grafics)
[..]
default: print default tab bar for all other nodes
/switch

Of course, this is not very dynamic, but usually the top structure of a website should not change too often.

Marco
http://www.hyperroad-design.com

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