PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

Multiple Search Templates; One set of installation files

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

  • Multiple Search Templates; One set of installation files

    Hi,

    Is it possible to have several customized search template pages for separate sections of a website but only one set of installation files?

    We want to customize the drop down category list order for each section of our website.

    I realize we can create multiple installations but I don't want to do this as it means more complexity and essentially multiple copies of the same installation files in 2 or 3 directories.

    If we could create custom search templates it would work well for our needs.

    Thank you.

  • #2
    Do you need different search templates (does the actual page layout of the search results vary), or do you just want different search forms?

    You can create any number of different search forms as you like, as explained in this FAQ:
    Q. How do I put search forms on pages besides the search page? (Or define my own search form?)

    So you could have a number of different search boxes, used in various parts of your site. The search results will appear on the same page despite the different search forms though, so one option is to disable the search form generated by the script, especially if you have the results in a frameset.
    --Ray
    Wrensoft Web Software
    Sydney, Australia
    Zoom Search Engine

    Comment


    • #3
      Here is what we want to do:

      We have 2 protected directories on our website that require subscriptions, I'll call these /protected/directory1 and /protected/directory2. When the user in directory1 I want the category search box drop down list to show directory1 as the top item and selected. When in directory2, I want the category search box drop down list to show directory2 as the top item and selected. We also have an online store that is not password protected and want the category search box to show the online store as the top item and selected. Same goes for the root directory - We would want All as the top item and selected. So, if the /protected/directory2 contains nothing but PDF files, the user doesn't want to search the entire web site and we want the drop down category to keep him searching in directory2 rather than have them have to reselect the category for every search.

      I understand how to create a custom form to generate the custom category drop down list order (I have already done this and it works fine) to create the forms needed to do this but if I use the same search results template would I simply leave the form off the search template and supply a back button to return to the previous screen to perform another search? If I put a form on the seeach template, then I want to put the form which pertains to the specific area they are searching (directory1, directory2, online store, etc.). I guess I could put multiple forms on the search template but this seems redundant and would clutter the template.

      I appreciate your help.

      Comment


      • #4
        If all you need to do is change the pre-selected category, you can do so by changing the way you link to your search page.

        So, in your example, the link in directory1 will point to the search page as something like: "../search/search.php?zoom_cat=1" (where 1 is the corresponding number for the directory1 category).

        Your search links in directory2, could point to the same page, but with "?zoom_cat=2" (or whatever number corresponds to the category desired).

        When you go to the search page with these parameters pre-specified in the URL, the corresponding category will be pre-selected in the dropdown box. This will not change the order of the categories however (which is probably a good thing, because it can be confusing for a user if the order keeps changing on different pages).

        Alternatively, if you have a custom search box (as opposed to a simple "Search page" link) on your other pages, you could specify a hidden <input> parameter as part of the form HTML, eg. <input type="hidden" name="zoom_cat[]" value="2">

        For more information, see the section titled "Defining a search form for a categories enabled website" in the custom search form FAQ:
        http://www.wrensoft.com/zoom/support...tml#searchform
        --Ray
        Wrensoft Web Software
        Sydney, Australia
        Zoom Search Engine

        Comment


        • #5
          OK - Thanks.

          This sounds like it will work for me.

          I will be able to work on this more over the weekend.

          Comment


          • #6
            Hi again,

            We are using both a customized search form and a customized search template.

            Using your suggestion above, we put the <input type="hidden" name="zoom_cat[]" value="0"> in our customized search form. When we input a search word and perform the search, it will go to the customized search template and will correctly search for the CATEGORY of value 0. OK so far - this part works great and when the search is performed, the search results are limited to that category; However you stated the category would also be pre-selected on the search template - In my case it is not. It defaults back to the ALL category. Am I missing a step or ?

            You can see this in action at:

            http://www.georgiagrindingwheel.com/testsearch.htm

            Try the word PINK as your search word. Note that this is not a public working page or template yet - We are still working on it before implementing on our site.

            Thank you again.

            Comment


            • #7
              The category will only be preselected on the search results page if you are using the Zoom automatically generated search form on the results page. If you are using your own search form, then you'll need to populate the values yourself (maybe with a script of some sort).

              When Ray was suggesting a custom search box, in the post above, I think he was refering to a custom form on "other pages" than the search results page.

              So reverting to the default form, on the search results page, would be one way to fix this.

              Comment

              Working...
              X