17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1466 Views |
-
Custom external links within navigation control

6 November 2008 at 6:48am
I want to link to external pages within my navigation. Is it possible to check the urlsegment within the control loop? Something like this:
<ul class="ir nav">
<% control Menu(1) %>
<li class="ir-$URLSegment"><a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode"><em>$MenuTitle</em></a>
<ul id="sub-$URLSegment">
<% control Children %>
<li><a href="$Link">$MenuTitle</a></li>
<% end_control %>
<% if $URLSegment="admissions" %>
<li><a href="#">Test Link</a></li>
<% end-if %>
</ul>
</li>
<% end_control %>
</ul>Basically I want to use the $URLSegment variable to test if I'm on the admissions page, and if so print links accordingly.
Thanks for the help.
-
Re: Custom external links within navigation control

6 November 2008 at 9:52am Last edited: 6 November 2008 9:52am
yes, but withing <% %> tags, you drop the dollar sign and the quotes. Also use == instead of =.
ie:
<% if URLSegment == admissions %>
<li><a href="#">Test Link</a></li>
<% end_if %> -
Re: Custom external links within navigation control

6 November 2008 at 10:53am
Perfect! That works great, thanks for your help!
-
Re: Custom external links within navigation control

6 November 2008 at 10:59am
I just realized my logic is screwy. I need the navigation to add links to external pages. For instance, the prior logic only added the "Test Link" where URLSegment == admissions. I need it to add that test link all the time under the admissions navigation. Is that possible? I'll keep looking.
-
Re: Custom external links within navigation control

6 November 2008 at 12:04pm
Move it into the control loop. At the moment you have it outside of the control loop.
-
Re: Custom external links within navigation control

7 November 2008 at 4:05am
Unfortunately even though that logic seems better, the "Test Link" doesn't appear in the menu. Here is what my code looks like now:
<ul class="ir nav">
<% control Menu(1) %>
<li class="ir-$URLSegment"><a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode"><em>$MenuTitle</em></a>
<ul id="sub-$URLSegment">
<% control Children %>
<li><a href="$Link">$MenuTitle</a></li>
<% if URLSegment == admissions %>
<li><a href="#">Test Link</a></li>
<% end_if %>
<% end_control %>
</ul>
</li>
<% end_control %>
</ul>Sorry to keep this going, I was just hoping this sort of thing would be rather simple.
Thanks again for your help!
| 1466 Views | ||
|
Page:
1
|
Go to Top |


