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.

Archive /

Our old forums are still available as a read-only archive.

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

overwrite or remove Menu(2) item


Go to End


1199 Views

Avatar
Anatol

126 Posts

18 November 2008 at 12:50pm

Hi,

I would like to overwrite a Menu(2) item in a Page_Controller method.

Here is the scenario: I added a search form as described in http://doc.silverstripe.com/doku.php?id=tutorial:4-site-search&s=search%20form and added the search results template to /my_template/templates/Layout/Page_results.ss

As usual all works well, but my second level navigation Menu(2) now displays a link to "Page Not Found", probably because the results page is a function but not part of the site tree so Silverstripe thinks the page does not exist.

I hope this makes sense.

I thought the best way to avoid this incorrect second level link is to either completely remove the link or replace it - preferably in the function that gets the search results.

Maybe there is another easy way that does not require to changes to the template. Any hint is highly appreciated.

Cheers!
Anatol