Jump to:

3435 Posts in 1026 Topics by 866 members

Template Questions

SilverStripe Forums » Template Questions » Search results template not rendering

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

Page: 1
Go to End
Author Topic: 1402 Views
  • ianpiper
    Avatar
    Community Member
    32 Posts

    Search results template not rendering Link to this post

    Hi all,

    I'm having trouble with rendering results from a search. I am using v2.3 and the installation had a SearchForm method already (slightly different from the one in the tutorial) so I used that. I created a template called Page_results.ss and put the code from tutorial 4 in it. When I run the search it seems to ignore the Page_results.ss file and instead loads Page.ss. I would have expected this if there were not Page_results.ss in the Layout folder because of this code in Page.php:

           return $this->customise($data)->renderWith(array('Page_results', 'Page'));

    But in this case there is a file called Page_results.ss, so why is it not being used?

    BTW I can be certain that Page.ss is the template that is rendering here and that the search is running, because if I put the search results handling code into Page.ss then it shows the appropriate results.

    If anyone can illuminate me I'd be grateful.

    Regards,

    Ian.
    --

    Ian.
    --

  • ianpiper
    Avatar
    Community Member
    32 Posts

    Re: Search results template not rendering Link to this post

    <blush>I forgot to rebuild my database</blush>. Once I did that the correct results page loaded.

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