PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

Template Integration, Search Results disjointed.

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

  • Template Integration, Search Results disjointed.

    Hi All,

    Working with DW8, PHP, and ZS Engine 5.1. I'm having issues getting search results to display in the controlled areas of my page.

    I'm using php include to include search.php into search_template.php. Search_template.php has a template applied to it. The body region in the middle of the page where I want the search results to appear contains:

    <?php include("search.php"); ?>

    All's well till you run a search. The page appears in all its glory, however, the search results appears under the footer, after all the template content.

    How can this be if I am including search.php in the middle of a controlled div?

    Any help from vetted users is much 'preciated.

    Thanks,
    Xeneize
    --
    ZS Engine 5.1

  • #2
    search_template.php is not our file, and as a result we don't know what is in it. We would need to see the code for the page to really know what is going on.

    See also this FAQ.
    Q. How can I add server-side scripting (eg. PHP, ASP) to the search template?

    Comment


    • #3
      Wrensoft,

      Thanks for the quick response. It is your template, it just has .php as the extension. I've updated settings.php to recognize it instead of the default search_template.html.

      But that was yesterday... in an effort to get things to work, I reverted back to the original files sets. The link you provide doesn't really give me the answer I'm looking for. My site is not built with includes such as a header and footer. I utilize a template and I have editable regions in my template where content can be placed.

      Here's the link:[Link removed at request of poster]

      You can see that the search results appear above (or below depending where I dump the PHP) and not in the middle of the page layout.

      Thanks for your help!
      --
      ZS Engine 5.1

      Comment


      • #4
        Resolved...

        I was able to figure it out... I'd like to share my findings just in case someone else is having the same issue.

        It's important to disable "Charset enforcing from search page" under the Advanced menu of the configurations panel. If you do not do this and plan on placing your search.php script inside a template, you will get PHP Header errors.

        So, to integrate your search results inside of an existing layout, simply dump all the code in search.php, in your main content area. Here's a snippet of mine:

        Code:
        <div class="bodyCol">
              <?php include("search_template.html"); ?>
              <Copy + Paste all the code from search.php here>
        </div>
        That's it. I know its not the most elaborate set of instructions but if you have trouble deciphering, just post back and I'll be happy to assist.

        Thanks!
        --
        ZS Engine 5.1

        Comment


        • #5
          [Search_template.php] It is your template, it just has .php as the extension. I've updated settings.php to recognize it
          Renaming the template file is pointless. It does not allow PHP code to be included in the template if that is what you are attempting. Instead you should use the method in the FAQ above. Editing the settings.php file will corrupt your set of index files and result in strange an unexplained errors down the track. So I reverting back to the original files set was a good idea.

          <Copy + Paste all the code from search.php here>
          This also is not a great idea. This means that any bug fixes we include in our script will not be picked up. Again we recommend you use the method in the FAQ above. The FAQ refers to header and footer includes, but this is just an example, any PHP code can be included before and after the search results.

          Comment


          • #6
            Originally posted by Xeneize View Post
            It is your template, it just has .php as the extension. I've updated settings.php to recognize it instead of the default search_template.html.
            Just want to emphasize that this is not a supported usage method.

            Your updating of the settings.php file is a mistake. This means you changed a file which contains this clear warning on the very first line:

            // WARNING: DO NOT EDIT THIS FILE.
            It's not a joke. Don't edit the file. You've corrupted the files in doing so, and after that, all bets are off.

            As already pointed out, the FAQ method applies here and is the recommended usage.
            --Ray
            Wrensoft Web Software
            Sydney, Australia
            Zoom Search Engine

            Comment

            Working...
            X