PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

results page layout

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • results page layout

    Im trying to configure the layout of my search results for my wordpress site. Ive setup the mysearch.php file, but Im not sure how to link that to the search_template.html. Ive read the FAQ, (http://www.wrensoft.com/zoom/support/faq_ssi.html), but Im not sure where to put the virtual header and Im not sure what file it goes in.

    Can you please try to simplify this for a newbie?

    Thanks!
    Kristin

  • #2
    There's no linking to "search_template.html", so I'm not sure what you are referring to there. "search.php" will utilize "search_template.html" internally. All you have to do is modify the template file and remove the header html if necessary (because by default it did not expect there to be other HTML before it).

    If you can give us the URL to the search function we can comment more specifically.

    The virtual include code mentioned in that FAQ goes in a "mysearch.php" file that you create. What this means is that this method allows you to create a PHP page containing the search function (search results, etc.) and any of your own PHP code, such as your headers or footers.

    I hope that helps but short of repeating what's in the FAQ, we really need you to elaborate on what you've done (or what you haven't done) to work out what may have been misunderstood.
    --Ray
    Wrensoft Web Software
    Sydney, Australia
    Zoom Search Engine

    Comment


    • #3
      Perhaps the following illustrations may help.

      This is the scenario that the default template file is designed for,



      But if you want to embed the search page within your own PHP page (so you can use PHP code for including other headers etc.) as described in the FAQ, then the template file need to be modified to accomodate the scenario as follows:



      Note that <!--ZOOMSEARCH--> is where search.php will insert the search results (and, by default, the search form if it is configured to generate the search form).
      --Ray
      Wrensoft Web Software
      Sydney, Australia
      Zoom Search Engine

      Comment


      • #4
        I created the mysearch.php file and put in the virtual calls like the FAQ example. I basically just copied over the layout from my single page template. My search_template.html file just has the <!--ZOOMSEARCH--> line in the file.

        Right now Ive only got the search on a pages that include a sidebar so here is a link to one of those pages:

        http://gcswordpress.accountsupport.com/small-arms-containers

        Im not sure why its not pulling in the modified layout. Any suggestions?

        Thanks!
        Kristin

        Comment


        • #5
          The search form on that page points to "search.php" instead of "mysearch.php". So this will naturally bypass your custom "mysearch.php" page, and all the user will see is the default behaviour (my first illustration above) after being taken to this URL:
          http://gcswordpress.accountsupport.com/search/search.php?zoom_query=container

          This is the HTML of your search form at the URL you gave in the post above, note the form action attribute:

          Code:
          <form method="get" action="../../../search/search.php">
          <input type="text" name="zoom_query" size="20" />
          <input type="submit" value=" " style= " border-style: none; background:url
          ('http://gcswordpress.accountsupport.com/wp-content/images/searchbutton1.gif') 
          no-repeat; width: 26px; height: 24px;"/>
          </form>
          So in theory, you just need to change the action= attribute to point to where your "mysearch.php" file is. However, I could not find the "mysearch.php" page you said you created as described. I tried going to this URL:
          http://gcswordpress.accountsupport.com/search/mysearch.php?zoom_query=container

          While there seems to be a page there, it is evidently not including "search.php" since it does not show any response from Zoom. The text message "Sorry, no posts matched your criteria" is not a Zoom response, and it seems to say this regardless of what query or parameter is passed to it.

          Is the "mysearch.php" file you created somewhere else, in a different folder? It would be easier if it was in the same folder as "search.php". But you need to be pretty careful with file paths when including files from different folders.
          --Ray
          Wrensoft Web Software
          Sydney, Australia
          Zoom Search Engine

          Comment


          • #6
            Ive moved the mysearch.php file to the same folder as the search.php and changed the form so it links to the mysearch.php. Now Im getting the following error:

            Fatal error: Call to undefined function virtual() in /hermes/web01c/b1092/as.gcswordpress/search/mysearch.php on line 1

            Here is the opening code in my mysearch.php file:

            <?php virtual ("../wp-content/themes/infocus/header.php"); ?>
            <?php virtual ("search.php"); ?>
            <?php virtual ("../wp-content/themes/infocus/footer.php"); ?>

            Im not sure how else to link the files if this is incorrect.

            Thanks!
            Kristin

            Comment


            • #7
              Your web server is setup in such a way that virtual() is not available. The FAQ mentions using either include() or virtual().

              Try replacing the "virtual" calls with "include".
              --Ray
              Wrensoft Web Software
              Sydney, Australia
              Zoom Search Engine

              Comment


              • #8
                I tried that and it still didnt work. Ill just modify the .html template

                Comment


                • #9
                  Can you elaborate on what happened when it "didn't work". I can't imagine it'd be the same behaviour or message as before because there wouldn't be any situation where a PHP setup would not allow the include() function.

                  But yes, modifying the HTML template to match the look of your site is the easiest solution.
                  --Ray
                  Wrensoft Web Software
                  Sydney, Australia
                  Zoom Search Engine

                  Comment


                  • #10
                    I kept getting a language callback attribute error, but Ive got the html page styled so its fine.

                    Comment

                    Working...
                    X