21309 Posts in 5738 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 424 Views |
-
Search form :: block 'assets' folder

1 September 2011 at 10:53am
Hello,
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?
Cheers
-
Re: Search form :: block 'assets' folder

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.
FulltextSearchable::enable(array('SiteTree'));
-
Re: Search form :: block 'assets' folder

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);
...
$form->classesToSearch(array('SiteTree'));(only classes you can enter are SiteTree and File...)
| 424 Views | ||
|
Page:
1
|
Go to Top |


