21490 Posts in 5783 Topics by 2622 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 671 Views |
-
Navigation

1 July 2011 at 9:01pm
Hello, yet again.
My new problem is this... in sitetree in menu(1) level I have 7 different pages, and then they span on.
The thing is, when using navigation:<% control Menu(1) %>
<li><a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode"><span>$MenuTitle.XML</span></a></li>
<% end_control %>I need it to show first 4 pages on one place and then 3 pages on another (so there will be 2 navbars)
Which function fo I have to override to be able to do this?Thank you
-
Re: Navigation

3 July 2011 at 7:35am Last edited: 3 July 2011 7:36am
Hi, I've already done this, but without creating any function.
A first solution would be to have two different classes for your level(1) pages. Let's say, for instance the "Menu1" page type, and the "Menu2" page type. Then, for your first navigation bar, your code would be :
<% control Menu(1) %>
<% if ClassName = Menu1 %>
<a href=$Link>$Title</a>
<% else %>
<% end_if %>
<% end_control %>
... and same thing with <% if ClassName = Menu2 %> for your second nav bar.A second solution would be to create a tickable box in the cms that the user checks if he wants the page to show up in the first nav bar. Let's call it "ShowInMenuOne". Your code becomes :
<% control Menu(1) %>
<% if ShowInMenuOne %>
<a href=$Link>$Title</a>
<% else %>
<% end_if %>
<% end_control %>
for the first nav bar and<% control Menu(1) %>
<% if ShowInMenuOne %>
<% else %>
<a href=$Link>$Title</a>
<% end_if %>
<% end_control %>
For the second nav bar.I'm sure it's not the most intelligent way to handle your problem, but it works !
-
Re: Navigation

28 July 2011 at 12:08am
Hey,
thanks for the answer, it helped.
It does work, it just doesn't feel right, but ok, I guess whatever gets the job done.Cya mate!
-
Re: Navigation

28 July 2011 at 7:20am
Similar to stallain's solution, but I'd add a field to the Page class for the two menu's that way you can filter on that field instead of class name, this will allow you to set it on any page type. Slightly more flexible because you're not reliant on having specific page-typesbuild your nav
| 671 Views | ||
|
Page:
1
|
Go to Top |



