We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31764
    • 6 Posts
    Hi All,

    I have installed SimpleSearch. Now i am busy with configuring to have search box and results on one page. On the search page i have the following code:

    [[!SimpleSearchForm? &tpl=`zoekResultatenTpl`]]

    <h2>Gevonden</h2>
    <p>[[!SimpleSearch]]</p>

    So far it is working fine and fast and very happy. But if i am visitig the search page i see an empty search box and below a no result message. The message is shown before I have done a search attempt. I want to see the no result message after a search wich have no results. Is there a way to do this?

    Mark
      • 37105
      • 194 Posts
      Hi Mark,

      You can do this with a small snippet. Just create a snippet with following code:

      <?php
      return $_GET['search'];


      Then call this snippet with an output filter like this:

      [[!GetSearchString:notempty=`[[!SimpleSearch]]`]]


      This snippet returns searchstring and when empty (no search submitted) it will not fire the snippet SimpleSearch. So only when submitted form the results (or no results found) will be shown.
        Codeplaza Webdesign: for professional websites at low cost
        • 31764
        • 6 Posts
        Hi DonQuicky,

        Thnx for you're reply. The answer is awesome and works flawless. Thnx!

        Mark
          • 37105
          • 194 Posts
          Glad I could help! Please consider marking my answer as solution and set question as answered. That helps other people with similar questions pointing to the solution smiley
            Codeplaza Webdesign: for professional websites at low cost