Jump to:

23459 Posts in 18906 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » Tutorial 4 - Site Search

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: 1078 Views
  • Ronin
    Avatar
    Community Member
    50 Posts

    Tutorial 4 - Site Search Link to this post

    As mentioned by others I have followed this tutorial and got the search facility showing up on the screen. However it produces no results. When I type in a nonsense string that wont be found there is no message coming up telling me that the search was unsuccessful so it feels like the results feature is not being found. I would greatly appreciate help on finding what I have done wrong.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Tutorial 4 - Site Search Link to this post

    Please post your code and the error you're getting.

  • Ronin
    Avatar
    Community Member
    50 Posts

    Re: Tutorial 4 - Site Search Link to this post

    No Errors are being generated. When I enter a valid search string the screen refreshs but nothing else happens. there is no message when an invalid string is entered and not found. The files that I modified for this feature are page.php, page.ss and page_results.ss. I have attached these files.

    Attached Files
  • shapeg
    Avatar
    Community Member
    4 Posts

    Re: Tutorial 4 - Site Search Link to this post

    Hi, Just had problems with search myself. I found that the Page.php file had the following line at the bottom.
    return $this->customise($data)->renderWith(array('Page_results', 'Page')); so it was looking for a file titled Page_results.ss. But my actual file was PageResults.ss. The fix is to rename them to match. I changed the page.php file to look for PageResults.ss and it all started working. In retrospect, perhaps I should have done it the other way by renaming the file.

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