Jump to:

1969 Posts in 1272 Topics by 606 members

Form Questions

SilverStripe Forums » Form Questions » Site search - RequiredFields and subsites

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

Page: 1
Go to End
Author Topic: 1034 Views
  • Carrie_Lang
    Avatar
    Community Member
    24 Posts

    Site search - RequiredFields and subsites Link to this post

    I was reading the site search tutorial and it seem to be a peace of cake. But there's a comment "This tutorial seems to rely on .css files that are not included with SilverStripe 2.4.5, The search page and search box do not show as in the tutorial unless the user creates their own CSS." and that made me confuced. So what elements do I need to add to css to get site search to SS 2.4.5?

    I tested and added the line mentioned in tutorial to config file, the site search form appeared to the header, but when I tried to move the $SearchForm to other place (other div), the form didn't appear. What files does include the codes related the site search in 2.4.5? If I want to put the search form to other div than Header do add the lines with #Header form { etc. to layout css but change the Header to the div I'm putting the form?

  • Carrie_Lang
    Avatar
    Community Member
    24 Posts

    Re: Site search - RequiredFields and subsites Link to this post

    Ok, I got the form working But now I'm having some little question without an answer yet.

    When I have subsites, how can I get the site search to search only for current subsite? Every subsite has it's own theme. I'm having a folder in the assets folder and that folder is marked to be only for one (other) subsite, so how do I make e.g. these files not to be shown in the other subsites search, as they now do.

    And what and where to add to make the search form to require at least one word. Now the search can be done with the empty form as well.

  • Carrie_Lang
    Avatar
    Community Member
    24 Posts

    Re: Site search - RequiredFields and subsites Link to this post

    I've tried to search for the right files where to add something like $validator = new RequiredFields('Search'); to make the search field required to fill. But yet I'm not sure about the right file. There are search files in sapphire/search/ so I thought there are some classes needed to copy to my Page-file to override those, but some pointers would be great.

    And the subsite issue is also something without an answer yet. With Secure files the files in the other subsite are not accessable from the subsite with the sitesearch, but it would still be great if those files wouldn't appear in search result.

    1034 Views
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.