Jump to:

3432 Posts in 1025 Topics by 865 members

Template Questions

SilverStripe Forums » Template Questions » Simple question about the top menu navigation

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1195 Views
  • boosis
    Avatar
    Community Member
    8 Posts

    Simple question about the top menu navigation Link to this post

    Hi,
    My SS consists of 4 main pages - People, Corporate, Projects, Knowledge. All other pages are under one of these. My top navigation code is

    <div id="topMenu">
    <ul class="clearfix">
        <% control Menu(1) %>
           <li><a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode"><span>$MenuTitle.XML</span></a></li>
        <% end_control %>
    </ul>
    </div>

    and an arrow appears under the menu title once it's selected.

    Now, everything works fine, but if go deep in the tree, I loose the arrow in the main navigation.

    Let's say. I am on people page. The arrow is under "People" menu item. But if I navigate to "People" -> "Our People" arrow disappears. I want to show that error for all children of People (or any other main menu item) page.

    Hope this makes sense.

    Thanks.

  • boosis
    Avatar
    Community Member
    8 Posts

    Re: Simple question about the top menu navigation Link to this post

    Css for the arrow is

    #topMenu ul li a.current
    {
    color: #48AA43;
    text-decoration: none;
    background: url('../images/selected_arrow.jpg') bottom center no-repeat;
    }

  • boosis
    Avatar
    Community Member
    8 Posts

    Re: Simple question about the top menu navigation Link to this post

    Sorted by assigning same css to .section tag.

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: Simple question about the top menu navigation Link to this post

    Or you could have used $LinkOrSection which returns link for plain, section for current or child. Useful tricks - http://doc.silverstripe.org/sapphire/en/reference/built-in-page-controls#linkingmode-linkorcurrent-and-linkorsection

    1195 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.