17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 3474 Views |
-
Vert Nav 2nd level issue.

5 April 2008 at 8:59am
So I'm trying to setup a multi-level vertical nav that only displays the children of the page that it's on.
The issue: with the code below, if you navigate to one of the second level pages, all the children in the vertical nav will go away. I want all of the 2nd level links to continue being displayed when you're on 2nd level pages.
In my navigation.ss file:
<ul>
<% control Menu(1) %>
<li><a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode"><span>$MenuTitle</span></a>
<% if isSection %>
<% control Children %>
<ul class="lvl2">
<li class="lvl2"><a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode levela"><span><em>$MenuTitle</em></span></a></li>
</ul>
<% end_control %>
<% end_if %>
</li>
<% end_control %>
</ul>Any ideas would be greatly appreciated. =]
-
Re: Vert Nav 2nd level issue.

6 April 2008 at 12:36pm Last edited: 6 April 2008 1:11pm
I've been playing with submenus too. Try replacing
with<% if isSection %>
<% if LinkOrSection = section %>
-billy
-
Re: Vert Nav 2nd level issue.

8 April 2008 at 3:06am Last edited: 8 April 2008 3:07am
As that works, I think the problem with my code is that when you navigate to the 2nd level page, it's looking for <% control Children %> so it starts looking for 3rd level children (which don't exist, so it displays nothing). What might be a work-around for this?
-
Re: Vert Nav 2nd level issue.

8 April 2008 at 2:44pm
maybe this...
<% if LinkOrSection = section %>
<% if Children %> -
Re: Vert Nav 2nd level issue.

9 April 2008 at 7:07am
see I think by saying if Children it's still looking for 3rd level children when you're on a 2nd level page.. kinda frustrating lol..
-
Re: Vert Nav 2nd level issue.

10 April 2008 at 10:55am
"see I think by saying if Children it's still looking for 3rd level children when you're on a 2nd level page.. kinda frustrating lol."
Not sure if I'm understanding correctly. Calling Children is context-sensitive and should only grab 3rd level children if they exist. Some code that should always show all submenus...
<% control Menu(1) %>
add level one menu stuff here
<% control Children %>
add level two menu stuff here
<% control Children %>
add level three menu stuff here
<% end_control %>
<% end_control %>
<% end_control %>Another example - always shows parents, only shows children of the page you are on...
<% if Menu(1) %>
<ul class="firstLevel">
<% control Menu(1) %>
<li><a href="$Link" title="$MenuTitle" class="$LinkingMode">$MenuTitle</a>
<% if LinkOrSection = section %>
<ul class="secondLevel">
<% control Children %>
<li class="$LinkingMode <% if FirstLast %>$FirstLast<% end_if %>">
<a href="$Link" title="$MenuTitle" class="$LinkingMode">$MenuTitle</a>
<% if LinkOrSection = section %>
<ul class="thirdLevel">
<% control Children %>
<li class="$LinkingMode <% if FirstLast %> $FirstLast<% end_if %>">
<a href="$Link" title="$MenuTitle" class="$LinkingMode">$MenuTitle</a>
</li>
<% end_control %>
</ul>
<% end_if %>
</li>
<% end_control %>
</ul>
<% end_if %>
</li>
<% end_control %>
</ul>
<% end_if %> -
Re: Vert Nav 2nd level issue.

10 April 2008 at 10:56am Last edited: 10 April 2008 10:59am
The 2nd example doesn't need <% if children %> because that's part of what <% control Children %> does. Well, at least that's my understanding of it all. Let me know if I'm not understanding/helping
-Billy
-
Re: Vert Nav 2nd level issue.

11 April 2008 at 7:59am
you rock, kind sir. that 2nd one is the ticket. thanks so very much
| 3474 Views | ||
|
Page:
1
|
Go to Top |


