17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1104 Views |
-
Search

5 July 2008 at 7:45am Last edited: 5 July 2008 7:46am
How can I restrict the search to only level 2 and 3 pages like the Menu(2), so if
Home
---Food
------Food1
---Special Food
------Food 1
------Food 2
About Foodit would only show
---Food
------Food1
---Special Food
------Food 1
------Food 2 -
Re: Search

5 July 2008 at 8:26am
In the CMS, you can make a page not show up in searches.
Alternatively, you could create a subclass of SearchForm, where you override searchEngine() to something like:
public function searchEngine($keywords, $numPerPage = 10, $sortBy = "Relevance DESC", $extraFilter = "", $booleanSearch = false, $alternativeFileFilter = "", $invertedMatch = false) {
return parent::searchEngine($keywords, $numPerPage, $sortBy, "SiteTree.ParentID = 0", $booleanSearch, $alternativeFileFilter, $invertedMatch);
}
Then use that class instead of SearchForm.
| 1104 Views | ||
|
Page:
1
|
Go to Top |

