Jump to:

22977 Posts in 11742 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » Each Sub-Menu shows Sub-Menu Entries from all Pages

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 380 Views
  • LKM
    Avatar
    Community Member
    1 Post

    Each Sub-Menu shows Sub-Menu Entries from all Pages Link to this post

    I have a pretty simple site whose page hierarchy looks a bit like this:

    - A
    +-- A1
    +-- A2
    +-- A3
    - B
    +-- B1
    +-- B2
    +-- B3
    - C
    +-- C1
    +-- C2
    +-- C3

    However, on the website itself, each top-level entry shows the second-level entries from all top-level entries, not just its own. So when I click on "B", I see all second-level entries from A1 to C3.

    I really have no clue how this happened; I've never had this problem with Silverstripe. It doesn't seem to be theme-dependent; resetting to the original "simple" theme does not fix the problem. Flushing does not help. /dev/build does nothing. Is there something wrong with the database? I don't know, and I don't know what to do to test this idea, or fix the problem if it's true.

    The Admin tools show the hierarchy just fine; it's only in the frontend where things are wrong.

    I really have no idea where to even start to fix this problem. Any help?

  • Nobrainer Web
    Avatar
    Community Member
    134 Posts

    Re: Each Sub-Menu shows Sub-Menu Entries from all Pages Link to this post

    Hi LKM,

    I'm abit unsure about how much you know about SS.
    But to me it sounds like a template issue.

    Somwhere in your code there is an include statement (Page.ss) that inlcudes a navigation file. try to make a new navigation file, and put the following content into it - this should be an expanding menu - meaning only showing menu items under active menu.

    <ul id="SubNavigation">
       <% control Menu(1) %>
       <li class="$LinkingMode lvl1 $FirstLast"><a href="$Link" title="$Title.XML" class="$LinkingMode levela">$MenuTitle.XML</a>
       
          <% if LinkOrSection = section %>
             <% if Children %>
                <ul class="SubLvl2">
                   <% control Children %>
                      <li class="lvl2"><a href="$Link" title="$Title.XML" class="$LinkingMode levelb">$MenuTitle.XML</a></li>
                   <% end_control %>
                </ul>
              <% end_if %>
          <% end_if %>
       </li>
       <% end_control %>
    </ul>

    Hope it helps, otherwise post more info and a version number please.

  • IOTI
    Avatar
    Community Member
    187 Posts

    Re: Each Sub-Menu shows Sub-Menu Entries from all Pages Link to this post

    Is this a brand new 3.0 site? did you upgrade from 2.4 to 3.0? When did this problem occur? Does using a brand new database fix the problem?

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