Jump to:

23459 Posts in 18906 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » Search not working

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 2 3 4
Go to End
Author Topic: 3545 Views
  • bettsaj
    Avatar
    Community Member
    46 Posts

    Search not working Link to this post

    Hi,

    For some reason the search function isn't working... Is there a module I've got to install or is there a function I need to enable in SS?

    URL to the site is..

    www.christinafrench.com

    Kind regards,

    Andy

  • Invader_Zim
    Avatar
    Community Member
    141 Posts

    Re: Search not working Link to this post

    Hi,

    check if you have this line in your /mysite/_config.php:
    FulltextSearchable::enable();

    and if you have this in your template where the search form should appear:
    $SearchForm

    Cheers

    Edit: Don't forget to rebuild the database by visiting http://yoursite.com/dev/build after adding Fulltext... to your _config.php
    Edit2: This link might also help: http://doc.silverstripe.org/sapphire/en/tutorials/4-site-search

  • bettsaj
    Avatar
    Community Member
    46 Posts

    Re: Search not working Link to this post

    Still not working.... I've added FulltextSearchable::enable(); where you said it should be.. I've also checked the template page.ss which now looks like this

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>

          <% base_tag %>
          $MetaTags
          <link rel="shortcut icon" href="/favicon.ico" />

    </head>
    <body>

    <div id="Wrapper">
       <div id="Header">
        $SearchForm
          <h1><span>Christina French</h1>
    <p class="tagline">Artist & Tutor</p>
    <input type="text" class="search" value="Search" />
    </div>
    <div id="Nav">
       <% include Navigation %>
    </div>

    $Layout
    <div class="clear"></div>

    <div id="Footer">
       <% include Footer %>
    </div>

    </div>

    </body>
    </html>

    Any ideas why it's still not working?.. Cache has been flushed 3 times now,

    Regards,

    Andy

  • DesignerX.com.au
    Avatar
    Community Member
    107 Posts

    Re: Search not working Link to this post

    Hi,
    i am not sure if i can help, but try plasing the $SearchForm just under the <body> & test it, it may be conflectiong with something else above it in the code!!.. give it a try..

    .... For now, i Need your help!!.. i saw your website, What gallery did you use (Gallery page).. i really need it.. Can you give me the link to that module..

    Thank you

  • bettsaj
    Avatar
    Community Member
    46 Posts

    Re: Search not working Link to this post

    Thanks for your advice... I'll give it a try.

    regarding the gallery you can find it here

    http://www.silverstripe.org/imagegallery-module/

  • DesignerX.com.au
    Avatar
    Community Member
    107 Posts

    Re: Search not working Link to this post

    thank you.. i am using the gallery now.. its the best.. but i need to get it to do the following:
    if there is ONLY one album, Do not show albums list!!
    can it be done..

  • bettsaj
    Avatar
    Community Member
    46 Posts

    Re: Search not working Link to this post

    Anybody have any ideas what I may be doing wrong with this search issue?

    What page do I place the $SearchForm line?... I've currently placed it in:

    mysite/themes/wine/templates/page.ss

    It's currently the first line after the body tag

  • martimiz
    Avatar
    Forum Moderator
    1078 Posts

    Re: Search not working Link to this post

    The reason it doesn't work, is that your searchform isn't a form at all. it's just a simple textinput without any submit action:

       <div id="Header">
        <h1><span>Christina French</span></h1>
    <p class="tagline">Artist &amp; Tutor</p>
    <input class="search" value="Search" type="text">
    </div>

    so for some reason placing $SearchForm in your template seems to only return that single field. How is your searchform created? Did you create a SearchForm() method yourself, or use some custom template?

    3545 Views
Page: 1 2 3 4
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.