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.

eZ debug

Timing: Jan 31 2025 06:18:27
Script start
Timing: Jan 31 2025 06:18:27
Module start 'layout'
Timing: Jan 31 2025 06:18:27
Module start 'content'
Timing: Jan 31 2025 06:18:27
Module end 'content'
Timing: Jan 31 2025 06:18:27
Script end

Main resources:

Total runtime0.0161 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 588.3906151.2422
Module start 'layout' 0.00520.0026 739.632836.7109
Module start 'content' 0.00780.0067 776.343890.2188
Module end 'content' 0.01450.0016 866.562529.9922
Script end 0.0161  896.5547 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002314.1920140.0002
Check MTime0.00106.2807140.0001
Mysql Total
Database connection0.00095.552110.0009
Mysqli_queries0.002415.056930.0008
Looping result0.00000.099210.0000
Template Total0.00116.810.0011
Template load0.00085.094510.0008
Template processing0.00031.707510.0003
Override
Cache load0.00053.409210.0005
General
dbfile0.00138.243080.0002
String conversion0.00000.037040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs