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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

[SOLVED] Hide assets from local site search results


Go to End


2 Posts   1452 Views

Avatar
jaybee

Community Member, 49 Posts

21 August 2010 at 9:22am

Edited: 22/08/2010 7:01am

How do you hide assets from the local system site search function? We're having PDF's show up that we don't want to and Secure Files module doesn't appear to do anything for this. Thanks for any help.

Avatar
jaybee

Community Member, 49 Posts

22 August 2010 at 7:00am

I found the solution on the search tutorial page

The solution:

"If you don't want any Files to be found add" to the page.php under mysite/code

public function results($data, $form)
{
$form->classesToSearch(array('SiteTree'));