Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

Each Sub-Menu shows Sub-Menu Entries from all Pages


Go to End


3 Posts   1106 Views

Avatar
LKM

Community Member, 1 Post

11 February 2013 at 8:04am

Edited: 11/02/2013 8:04am

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?

Avatar
Nobrainer Web

Community Member, 138 Posts

11 February 2013 at 11:03am

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.

Avatar
copernican

Community Member, 189 Posts

12 February 2013 at 6:06am

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?