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

SilverStripe Main Navigation


Go to End


3 Posts   1329 Views

Avatar
barrycorrigan

Community Member, 10 Posts

26 March 2011 at 3:18am

Hi Everyone,

I'm new to SilverStripe I have went through the tutorials to create a basic site, and now im building one for a client now.

I've started with the Main Navigation which looks like this

<ul id="nav">
<li><a href="company.php" id="company" >Company</a>
			<ul class="submenu">
        		<li><a href="#">About us</a></li>
        		<li><a href="#">How we raise funds</a></li>

            	<li><a href="#">Why we recycle</a></li>
            	<li><a href="#">FAQs</a></li>
        	</ul>
		</li>
		<li><a href="recycling.php" id="recycling" >Recycling</a>
			<ul class="submenu">
        		<li><a href="textile-recycling.php">Textile Recycling</a></li>

        		<li><a href="#">Mobile Phone/Gadget Recycling</a></li>
        		<li><a href="#">Host a clothing bank</a></li>
        		<li><a href="#">Lost property recycling</a></li>
        	</ul>
		</li>
		<li><a href="campaigns.php" id="campaigns" >Campaigns</a>
			<ul class="submenu">

        		<li><a href="#">Despicable Me School Campaign</a></li>
        		<li><a href="#">SOS Shoe Campaign</a></li>
            	<li><a href="#">Schools</a></li>
            	<li><a href="#">Bra Campaigns</a></li>
        	</ul>
		</li>
		<li><a href="partners.php" id="partners" >Partners</a>

			<ul class="submenu">
        		<li><a href="#">Dorest &amp; Somerset Air Ambulance</a></li>
        		<li><a href="#">Essex Air Ambulance</a></li>
            	<li><a href="#">Francis House</a></li>
            	<li><a href="#">Hampshire &amp; Isle of Wight Air Ambulance</a></li>

            	<li><a href="#">Keep it up Campaign</a></li>
            	<li><a href="#">Naomi House</a></li>
            	<li><a href="#">Thames Valley &amp; Chiltern Air Ambulance</a></li>
            	<li><a href="#">Whizz-Kidz</a></li>
            	<li><a href="#">Wigan Warriors Community Foundation</a></li>

            	<li><a href="#">Yorkshire Air Ambulance</a></li>
        	</ul>
		</li>
        <li class="news"><a href="news.php" id="news" >News</a></li>
	</ul>

But in the CMS there are main pages that are not part of the navigation how do I get so it doesn't show these pages. For example the home page. This is proving quite confusing.

This is what I have so far but it is listing all my pages

<ul id="nav">
        		<% control Menu(1) %>
				<li><a href="$Link" id="$MenuTitle" title="Go to the $Title.XML page">$MenuTitle</a>
					<% if Children %>
					<ul class="submenu">
						<% control Children %> 
        					<li><a href="$Link">$Title.XML</a></li>
            			<% end_control %>
        			</ul>
        			<% end_if %>
				</li>
				<% end_control %>
			</ul>

Regards

Barry

Avatar
swaiba

Forum Moderator, 1899 Posts

26 March 2011 at 4:05am

Hey Barry

Try unchecking "Show in Menus" that can be found on the Behaviour tab of each SiteTree object.

Barry

Avatar
barrycorrigan

Community Member, 10 Posts

26 March 2011 at 4:57am

Hey swaiba,

Thanks for that, Got it sorted.

Thanks

Barry