Jump to:

23545 Posts in 19310 Topics by 2888 members

General Questions

SilverStripe Forums » General Questions » Search result url

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: 612 Views
  • martbarr
    Community Member
    46 Posts

    Search result url Link to this post


    Have search working well on my main site that is installed in root folder.

    But my test copy on a different server in a sub folder /ss245 doesn't work.
    When I hit the search button it takes me to www.mysite.com/home/SearchForm?action_results=Search&Search=wotilookfor

    So what do I change so that this goes to

    Code in my page.php:-
    function SearchForm() {
    $searchText = isset($_REQUEST['Search']) ? $_REQUEST['Search'] : 'Search';

        $fields = new FieldSet(
    new TextField("Search", "", $searchText)
    $actions = new FieldSet(
    new FormAction('results', 'Search')
    function results($data, $form){
    $data = array(
    'Results' => $form->getResults(),
    'Query' => $form->getSearchQuery(),
    'Title' => 'Search Results'
    $this->Query = $form->getSearchQuery();

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

  • martbarr
    Community Member
    46 Posts

    Re: Search result url Link to this post

    Sorry guys - this was just a corrupted file in my sapphire folder - nothing more exciting !

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.