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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

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

Custom entries in a menu

Go to End

3 Posts   903 Views

Chris J

Community Member, 10 Posts

18 January 2011 at 1:35pm

I have a drop down menu which I want to add extra pages to. These pages are already in the menu but need to be in there more than once.

Below is an example of my dropdown menu with a manual addition of a link. (The if ID = 6 condition)

<ul id="drop_down">
	<% control Menu(1) %>
		<% if Children %>
			<li><a href="$Link" title="View more info about $Title"><span>$MenuTitle</span></a>
					<% control Children %>
						<li><a href="$Link" title="View more about $Title">$MenuTitle</a></li>
					<% end_control %>
					<% if ID = 6 %>
						<li><a href="trips-and-tours-by-type/trip-dates/" title="View more about trip dates">Trip Dates</a></li>
					<% end_if %>
		<% else %>	
			<li><a href="$Link" title="View more info about $Title">$MenuTitle</a></li>
		<% end_if %>
	<% end_control %>

This works but I want to know if I can rewrite this in a way that I can access

etc... for the additional page?



Forum Moderator, 1391 Posts

18 January 2011 at 11:42pm

You could try and use a virtual page in your sitetree, pointing to the page you want to display. Maybe that will work for you - though I believe there are some issues regarding the display of DataObjects on virtual pages...

Chris J

Community Member, 10 Posts

25 January 2011 at 1:33pm

Yea Virtual pages are not really what I need. I have stuck with hard coding in the HTML for now. If anyone else has any ideas I would appreciate that. Cheers