17488 Posts in 4473 Topics by 1978 members
| Go to End | Next > | |
| Author | Topic: | 4285 Views |
-
LinkingMode help needed......

14 October 2008 at 2:10am
Hello everyone....!
I have a vertical menu with indented children and the code below works well for me. The only thing I cannot get to work is the Linking Mode to work. I basically want the active page to be highlighted regardless of whether it is level 1, 2 or 3 of the nav.
Can anyone help me out? I'll buy you a chocolate bar!
Thanks
/Adam<ul>
<% control Menu(1) %>
<li><a href="$Link" title="Go to the $Title.XML page" <% if LinkingMode %>class="$LinkingMode"><% end_if %>$MenuTitle</a>
<% if LinkOrSection = section %>
<% if Children %>
<div id="leftbox_sub">
<ul>
<% control Children %>
<li><a href="$Link" title="Go to the $Title.XML page">$MenuTitle</a>
<% if LinkOrSection = section %>
<% if Children %>
<div id="leftbox_sub2">
<ul>
<% control Children %>
<li><a href="$Link" title="Go to the $Title.XML page">$MenuTitle</a>
<% if LinkOrSection = section %>
<% if Children %>
<div id="leftbox_sub3">
<ul>
<% control Children %>
<li><a href="$Link" title="Go to the $Title.XML page">$MenuTitle</a></li>
<% end_control %>
</ul>
</div>
<% end_if %>
<% end_if %>
</li>
<% end_control %>
</ul>
</div>
<% end_if %>
<% end_if %>
</li>
<% end_control %>
</ul>
</div>
<% end_if %>
<% end_if %>
</li>
<% end_control %>
</ul> -
Re: LinkingMode help needed......

14 October 2008 at 10:03am
ctive page to be highlighted regardless of whether it is level 1, 2 or 3 of the nav.
Then you would use class="$LinkOrSection" which will return 'link' if its not on this page or a child. Or 'section' if its on this page or a child
-
Re: LinkingMode help needed......

14 October 2008 at 10:10am
and do I apply that class to the <ul> or <li>?
-
Re: LinkingMode help needed......

14 October 2008 at 10:42am
You should apply the class to the <li> or the <a> tag. Of course you'll still need a appropriate css stylesheet.
-
Re: LinkingMode help needed......

14 October 2008 at 10:48am
so my code should look like this..... (see below)
and then I create classes for 'link' and 'section'?
(sorry to be so slow!)
>
<% control Menu(1) %>
<li><a href="$Link" title="Go to the $Title.XML page" class="$LinkOrSection">$MenuTitle</a>
<% if LinkOrSection = section %>
<% if Children %>
<div id="leftbox_sub">
<ul>
<% control Children %>
<li><a href="$Link" title="Go to the $Title.XML page" class="$LinkOrSection">$MenuTitle</a>
<% if LinkOrSection = section %>
<% if Children %>
<div id="leftbox_sub2">
<ul>
<% control Children %>
<li><a href="$Link" title="Go to the $Title.XML page" class="$LinkOrSection">$MenuTitle</a>
<% if LinkOrSection = section %>
<% if Children %>
<div id="leftbox_sub3">
<ul>
<% control Children %>
<li><a href="$Link" title="Go to the $Title.XML page" class="$LinkOrSection">$MenuTitle</a></li>
<% end_control %>
</ul>
</div>
<% end_if %>
<% end_if %></li>
<% end_control %>
</ul>
</div>
<% end_if %>
<% end_if %>
</li>
<% end_control %>
</ul>
</div>
<% end_if %>
<% end_if %>
</li>
<% end_control %>
</ul> -
Re: LinkingMode help needed......

14 October 2008 at 10:02pm
hmmm..... this didn't work. Where are I going wrong?
-
Re: LinkingMode help needed......

16 October 2008 at 3:03am
I've attached a screenshot of the effect I want to achieve.
Level 1 - Black
Level 2 - Blue
Level 3 - Red
Level 4 - GreenIn this screenshot the page 'Bronze Award' is the active page and therefore the link I want to show in it's active state.
Hope someone out there can help me....! Here is my code as it stands
<ul>
<% control Menu(1) %>
<li><a href="$Link" title="Go to the $Title.XML page" class="$LinkOrSection">$MenuTitle</a>
<% if LinkOrSection = section %>
<% if Children %>
<div id="leftbox_sub">
<ul>
<% control Children %>
<li><a href="$Link" title="Go to the $Title.XML page" class="$LinkOrSection">$MenuTitle</a>
<% if LinkOrSection = section %>
<% if Children %>
<div id="leftbox_sub2">
<ul>
<% control Children %>
<li><a href="$Link" title="Go to the $Title.XML page" class="$LinkOrSection">$MenuTitle</a>
<% if LinkOrSection = section %>
<% if Children %>
<div id="leftbox_sub3">
<ul>
<% control Children %>
<li><a href="$Link" title="Go to the $Title.XML page" class="$LinkOrSection">$MenuTitle</a>
</li>
<% end_control %>
</ul>
</div>
<% end_if %>
<% end_if %>
</li>
<% end_control %>
</ul>
</div>
<% end_if %>
<% end_if %>
</li>
<% end_control %>
</ul>
</div>
<% end_if %>
<% end_if %>
</li>
<% end_control %>
</ul>
| 4285 Views | ||
| Go to Top | Next > |



