3212 Posts in 847 Topics by 809 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1729 Views |
-
Get current page level

9 July 2010 at 10:25pm
Hello,
Is there a simple way of getting the level of the current page within the navigation structure? I.e. top of section, sub page, sub sub page etc.
The reason is that I need the submenu for each section to appear in a different place depending on whether the user is on a top level section page or a sub page. So for example, in the following structure:
About us
|- The past
|- The future
|- MembersThe 'the past, the future, members' submenu would appear at the *top* on the 'About us' page but on the *bottom* of the 'The Past' page. Realise this is a very confusing description but hope it makes vague sense. Is this possible?
-
Re: Get current page level

13 July 2010 at 7:42pm
In the control of Level(1) or Menu(1) you can check the linking mode:
<% if LinkingMode = current %>
// This would be the About us page
<% else_if LinkingMode = section %>
// This would be the sub pages
<% else_if LinkingMode = link%>
// This would be out of this section completely
<% end_if %>
-
Re: Get current page level

13 July 2010 at 8:47pm
Thanks for your reply; that tests for the level of the page being linked *to* but not the current (i.e. referring) page, which is what I need to do! Any other thoughts?
-
Re: Get current page level

13 July 2010 at 10:40pm Last edited: 13 July 2010 10:40pm
I can't believe I didn't remember this before:
<% if Level(1) %>
// Do what you want
<% else_if Level(2) %>
// Do what you want
<% else %>
// Do what you want
<% end_if %>
| 1729 Views | ||
|
Page:
1
|
Go to Top |


