23478 Posts in 18941 Topics by 2878 members
|Go to End|
1 September 2011 at 10:53am
I've set up the search form on a website, but i've noticed the search finds files that are in the assets folder. I don't really the search to look through these - just the content pages.
Is there a way to do this?
3 September 2011 at 8:47pm
In your _config.php you should have something along the lines of FulltextSearchable::enable() to turn on searching, you can pass an array without 'File' to exclude assets.
4 September 2011 at 3:17am Last edited: 4 September 2011 3:19am
If you're using the default searchform, you should also be able to do something like this:
$form = new SearchForm($this, "SearchForm", $fields, $actions);
(only classes you can enter are SiteTree and File...)
|Go to Top|