Jump to:

5521 Posts in 1733 Topics by 1220 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Search with own theme doesn't work

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

Page: 1
Go to End
Author Topic: 943 Views
  • Roelfsche
    Avatar
    25 Posts

    Search with own theme doesn't work Link to this post

    Hi,
    I created my own theme an recognized, the search functionality doesn't work. I red the search tutorial - the necessary code is already in the Page.php file.
    If I use 'blackcandy' the search works, if I use my own theme, it does not.
    Any suggestions?
    Thanks in advance,
    roelfsche

  • Willr
    Avatar
    Forum Moderator
    5490 Posts

    Re: Search with own theme doesn't work Link to this post

    Have you got a Page_results.ss template for the result listing in your custom theme? This is the template for the results page - so if you don't have one you won't see any results. If thats not the issue you might want to explain a bit better what isn't working.

  • Roelfsche
    Avatar
    25 Posts

    Re: Search with own theme doesn't work Link to this post

    I have a Page_results.ss in my template.
    And I don't know why, but after switching back to my template, it works. Yesterday I tried serveral hours to get it work, cleared the cache, rebuildt the db and so on. Is there any other option I have to set (that may be automatically is done when switching the template)?
    So long, thank you for your reply.
    roelfsche

  • Roelfsche
    Avatar
    25 Posts

    Re: Search with own theme doesn't work Link to this post

    Hmmm...
    I try to modify things with searching - translation and layout - and the same behaviour like upstairs described occurs.
    After some tests the SearchForm jumps to my homepage and don't show results.
    If I switch the theme to blackcandy and back everything works fine, again...
    Does anybody has a explaination for that?
    My theme directory looks like this:

    theme1
    [dir]css
    [dir]images
    [dir]templates
    --------[file]Page.ss
    --------[dir] Layout
    ----------------[file]Page.ss
    ----------------[file]Page_results.ss

    I found out, that the HTML form-tag isn't filled, if I use my own theme. If I switch to blackcandy the following form tag is rendered:

    <form enctype="application/x-www-form-urlencoded" method="get" action="/contact-us/SearchForm" id="SearchForm_SearchForm">

    In my template it only looks like this:

    <form>

    I have no idea, what's the reason for that.
    Thank you in advance,
    Roelfsche

  • Roelfsche
    Avatar
    25 Posts

    Re: Search with own theme doesn't work Link to this post

    Oh my god, I'm so stupid...
    I wrapped the form in my template within an empty form tag, I used for test reasons...

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