Combination of {DROPDOWN} and {NAV_LIST_ALL}?

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
kipara
Posts: 26
Joined: Thu 16. Sep 2004, 20:48
Location: Bangkok, Thailand

Post by kipara »

The first example is what we have now.

The second and third are a way of achieving what I need. Calling it a parent in the third example was a mistake, but if I can target this 'outer <li>' with a class (like li.activeparent ul) it will work.

What you desribe is actually the same as what I want:
1) the current level highlighted (as is done now with activeclass)
2) the outer <li> highlighted (with a new to be introduced class)

Ideally, this would happen for every level up. An example of this behaviour (NOT with correct CSS implementation, but to show what I mean) is here: http://www.netherlandsembassy.cz/en/index.html

Example:

Code: Select all

<ul> 
<li>1 ***visible list element
<ul> 
<li>1.1</li> ***drop down list element
</ul></li> 
<li>2<ul class='activeparent'> ***visible list element (would normally be hidden, but as this node contains the active element it must be visible)
<li>2.1</li> ***visible list element
<li class='activeclass'>2.2</li>  ****visible list element ACTIVE
</ul></li> 
<li>3 ***visible list element
<ul> 
<li>3.1</li> ***drop down list element
</ul></li>
</ul>
Is this clear now? Javascript can do this I think, but I'd like to avoid it.
Jens*
Posts: 56
Joined: Fri 18. Jun 2004, 18:53

Post by Jens* »

Is something like this possible with the code?

Code: Select all

 <div id="navcontainer">
<ul id="navlist">
<li id="active"><a href="#" id="current">Item one</a>
<ul id="subnavlist">
<li id="subactive"><a href="#" id="subcurrent">Subitem one</a></li>
<li><a href="#">Subitem two</a></li>
<li><a href="#">Subitem three</a></li>
<li><a href="#">Subitem four</a></li>
</ul>

</li>
<li><a href="#">Item two</a></li>
<li><a href="#">Item three</a></li>
<li><a href="#">Item four</a></li>
</ul>
</div>
thx..
kipara
Posts: 26
Joined: Thu 16. Sep 2004, 20:48
Location: Bangkok, Thailand

Post by kipara »

@Jens: The question is "why would you want that?" :D

The following gives you just as much control and you can target all the elements you need (and is, indeed, what I'm looking for!):

Code: Select all

div id="navcontainer"> 
<ul> 
<li id="active"><a href="#">Item one</a> 
<ul> 
<li id="subactive"><a href="#">Subitem one</a></li> 
<li><a href="#">Subitem two</a></li> 
<li><a href="#">Subitem three</a></li> 
<li><a href="#">Subitem four</a></li> 
</ul> 
</li> 
<li><a href="#">Item two</a></li> 
<li><a href="#">Item three</a></li> 
<li><a href="#">Item four</a></li> 
</ul> 
</div> 
Jens*
Posts: 56
Joined: Fri 18. Jun 2004, 18:53

Post by Jens* »

why i want that?

I found some nice css menue's at http://css.maxdesign.com.au/listamatic2/index.htm
kipara
Posts: 26
Joined: Thu 16. Sep 2004, 20:48
Location: Bangkok, Thailand

Post by kipara »

What I meant is that the code 'suffers' from unnecessary id's.

<ul id="subnavlist"> can be targeted with #navcontainer ul ul

<a href="#" id="subcurrent"> can be targeted with #navcontainer #subactive a

...and so forth.

I haven't looked at the menus, but unless there is a lot of javascript going on to make things work, I don't see the need for all those id's.
Post Reply