Forums / Setup & design / how to show a context-dependent navigation bar?

how to show a context-dependent navigation bar?

Author Message

nicola muratori

Tuesday 03 June 2003 6:03:22 am

hi

i have a content structure like this:

....
A (class 1)
B (class 2)
C (class 3)
D (class 4)

and so on. i have to build a navigation bar to show, for examples, all objects under A, even when i'm viewing B, C or D.

there will be many structures like this in my content tree. so i have to
make this dynamic without specifying the object id of A.

i've tried to use the path object to fetch the first occurrence in the navigation tree, but i don't know how to get the class and the node id of the path element.

any ideas?

Frode Marton Meling

Wednesday 04 June 2003 11:58:03 pm

My suggestion would be to look at the SiteMap template inside standard, and then apply different class filters to the fetch.

Fetch Example:
{section name=test loop=fetch(content,tree,hash(parent_node_id,1,depth,10,class_filter_type,exclude,class_filter_array,array(2)))}

your usage of the fetch
{/section}

This example will loop through all objects but those with class_id=2.
If I only wanted to show class A and class B (ID=10,11) the fetch would look like this fetch(content,tree,hash(parent_node_id,1,depth,10,class_filter_type,include,class_filter_array,array(10,11)))

hope this helps you

MartOn