Exclude pagename from search

Vote:
 
We have pages that are not meant to displayed. They are only containers for other pages. The problem we have is that these pages are found in searches if we search on a word that is in the pagename. Is it a way to exclude the pagename for certain pagetypes from the search?
#12153
Oct 27, 2004 11:12
Vote:
 
You can do this by adding a filter to the search. For example, if you want to exclude pages in the standard search template, just add a filter to the SearchResults webcontrol, defined in Search.ascx.cs: private void Page_Load(object sender, System.EventArgs e) { SearchResults.Filter += new FilterEventHandler(SearchResults_Filter); } private void SearchResults_Filter( object sender, EPiServer.Filters.FilterEventArgs e) { // filter pages here... } For more info see http://www.episerver.com/templates/faq____3404.aspx.
#13747
Oct 27, 2004 12:17
Vote:
 
Tack så mycket för tipset och koden. Nu fungerar det som jag vill.
#13748
Oct 27, 2004 13:25
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.