Jump to:

23478 Posts in 18941 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Search form :: block 'assets' folder

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

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

Page: 1
Go to End
Author Topic: 659 Views
  • Futureweb
    Community Member
    232 Posts

    Search form :: block 'assets' folder Link to this post


    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?


  • Willr
    Forum Moderator
    5502 Posts

    Re: Search form :: block 'assets' folder Link to this post

    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.


  • martimiz
    Forum Moderator
    1086 Posts

    Re: Search form :: block 'assets' folder Link to this post

    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...)

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.