Help with PicoSearch

How can I use a Professional or Premium Plan template to customize my search box and buttons?

Using the template in your Professional or Premium account, you can customize all of the page layout around the search results which are returned by PicoSearch. To customize within the search results themselves, first look at the settings supported in your account manager's Designing sections, where you can specify such things as Tables and Columns, Fonts and Colors, and information per document. Then for even more control, you can use template codes to affect the results display for such things as CSS styling and customized status messages.
 
You may also wish to completely redesign the look or location of the search box on your search results page. The custom box and button as seen above in the 'Search the FAQs' of this page is an example of this. Here's what to do:
  1. In your account manager's Page Design section, turn off the default search box and buttons.
     
  2. Go to your account's PicoSearch search box page, selected by "How to Add a Search Box". Cut for pasting the code which is displayed for a basic search box and button. Make sure you get this code after choosing any settings you want in your account manager such as Partitions or AutoComplete, because then the HTML for these options will be included.
     
  3. Go to your account's template page, selected by "Customize Template." Paste the basic search box code into your template space. (Make a template around it if you have not already done so.)
     
  4. Modify the box and button as much as you like (wider, different wording, multiple locations, you name it!) Then, to get the current search to display in the box itself each time for the user, set the value of the VALUE attribute for INPUT TEXT tag to be _FORMQUERY. Thus you should have a line that looks like this:
    <input type="text" name="query" value="_FORMQUERY" size="20" />
     
  5. Make sure you still have the _QUERYRESULTS keyword in your template for the results to show in. Then update the template and try it out!

Initializing: Settings in your account manager's Designing sections help you to specify the look and feel of the search results when any of your search boxes enter a search. You can also load the search from a particular search box by initializing some options within the HTML code for that search box. See the FAQ on how to initialize the search for details.

Perpetuating State: The search results page must perpetuate various state variables of the search through the HTML form. For example, when the user checks the Search Within box, it needs to stay checked in the next display of the search results. When PicoSearch makes the default search box, all of this is handled for you. If you make a custom search box, you will need to help PicoSearch find some of your search box components in order to perpetuate their states properly.

You don't have to do all the work, because PicoSearch will try to automatically perpetuate most states for you by looking for the hidden input tag that has your account number. A working search box must have this anyway, and it looks like: <input name="index" type="hidden" value="123456">   To verify that this is working, when you search again in your results page you should see additional input tags inserted after it when you view the source. And if you have a simple help link with cgi args on the URL, this will also get more states inserted, as long as it begins with: http://www.picosearch.com/cgi-bin/ts.pl?index=123456&help=help

If you are using the Any/All/Exact matches dropdown box, the way to perpetuate the user's selections are to add the keywords _ANYSELECTED, _ALLSELECTED, and _EXACTSELECTED within each OPTION tag's set of codes respectively. These words will get filled in at runtime to be blank or the appropriate HTML code to mark the current selection as selected. A similar procedure is used for partitions, see the Partition FAQ for the _SEL_ keyword pattern. If you use a Within Results box, add _CHECK_WITHIN to that INPUT tag's set of codes, so the box will remain checked when it is used. If you offer the choice between Relevancy versus Date sorting, _SORTSELREL and _SORTSELDATE are the keywords to add to the OPTION tags for the current selection to be selected.

If you are making your own language selection for a multilingual site, you can perpetuate the state of check boxes with _CHECK_LANG_(lang), and drop down selections with _SEL_LANG_(lang). For example, a button for Spanish would need _CHECK_LANG_Spanish for its state to be perpetuated.

If you need to tinker more with your template, remember to try the template codes. Of course, the custom search box itself allows you to considerably change what the user sees. If you have other needs, just ask us!

Back to FAQs