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

Tutorial 4 - Site Search


Go to End


4 Posts   1648 Views

Avatar
Ronin

Community Member, 50 Posts

7 January 2009 at 1:58pm

Edited: 07/01/2009 2:12pm

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.

Avatar
UncleCheese

Forum Moderator, 4102 Posts

7 January 2009 at 2:47pm

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

Avatar
Ronin

Community Member, 50 Posts

7 January 2009 at 4:52pm

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.

Avatar
shapeg

Community Member, 4 Posts

1 February 2010 at 6:41am

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.