Jump to:

3444 Posts in 1030 Topics by 871 members

Template Questions

SilverStripe Forums » Template Questions » navigation sort - resolved

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

Page: 1
Go to End
Author Topic: 394 Views
  • cyshift
    Avatar
    Community Member
    2 Posts

    navigation sort - resolved Link to this post

    hello guys,

    sorry but my english is not very good.

    I'm new here and have a question.

    i have a main navigation:

    <ul>
    <li>Startpage</li>
    <li>Portfolio</li>
    <li>Contact</li>
    <li>…</li>
    <li>…</li>
    </ul>

    I would like that the current navigation point always comes at first Position.

    As Example:
    <ul>
    <li class="current">Portfolio</li>
    <li>Startpage</li>
    <li>Contact</li>
    <li>…</li>
    <li>…</li>
    </ul>

    or:

    <ul>
    <li class="current">Contact</li>
    <li>Startpage</li>
    <li>Portfolio</li>
    <li>…</li>
    <li>…</li>
    </ul>

    how can I define this sorting ?

    Many thanks

  • cyshift
    Avatar
    Community Member
    2 Posts

    Re: navigation sort - resolved Link to this post

    Hi,

    i found a solution:

    <ul>
    <% control Menu(1) %>
    <% if LinkingMode = current %>
    <li class="current">
    <a href="$Link">$MenuTitle.XML</a>
    <div class="arrow"></div>
    </li>
    <% else_if LinkingMode = section %>
    <li class="current">
    <a href="$Link">$MenuTitle.XML</a>
    <div class="arrow"></div>
    </li>
    <% end_if %>
    <% end_control %>
    <% control Menu(1) %>
    <% if LinkingMode = link %>
    <li>
    <a href="$Link">$MenuTitle.XML</a>
    <div class="arrow"></div>
    </li>
    <% end_if %>
    <% end_control %>
    </ul>

    it works great

    394 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.