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

Menu groupings or Menu items with no link?

Go to End

2 Posts   1495 Views


Community Member, 49 Posts

9 April 2010 at 2:30am

Edited: 09/04/2010 8:12pm

This is a realistic scenario. Is it possible to create menu items that have no link or content?

This type of item is often used with JS to mouse over to reveal a second level menu items without being a link to any content in the CMS but may require class so that an <a> tag (with response none) can be added with JS to enable keyboard navigation for tabbing in the menu to work.

It is also used to simply group menu options and should have the option to include or not include <a> tag.

If not what is the best work around?

If I am not explaining this very well the modified example attached may clear things up.

Attached Files

Forum Moderator, 5523 Posts

11 April 2010 at 1:18pm

What I normally do to get this working is use a RedirectorPage to group the entries then in the template if the classname is a RedirectorPage then don't include the link. The RedirectorPage can link off to either the homepage or another page (I use it as its included by default and won't leave random pages on the site).

<% control Children %>
<% if ClassName = RedirectorPage %>$MenuTitle<% else %><a href="$Link">$MenuTitle</a><% end_if %>
<% end_control %>

Or you could group the pages under the redirectorpage.