Help with PicoSearch

What codes can I use in my template to further customize my search results?

This FAQ is Part 4 of the series on using template codes to customize the search results page design for PicoSearch Professional and Premium accounts. For the beginning of the series, see Template Codes Overview FAQ


4. Layout Control Codes: move or remove sections of the search results page

Here we discuss codes for moving and removing different parts in the search results page. Initially we have the PICO_T code which lets you hide or unhide specific text, depending on whether any results were found. Then we have the PICO_RM codes that are used for removing specific tags universally, like removing all <table> or <i> and <b> tags. Finally we have the _PICO Add/Replace codes which let you move around standard messages and the page bar (the cue of links to more results). These are discussed in detail below, please feel free to Contact us for assistance.


PICO_T_BEG_HIDE_NOTFOUND etc.
Message for hiding or unhiding text when no results are found. You can wrap a piece of text in your template with these codes and have it appear when there are no results or have it disappear. Just make sure there are no other comments to interfere within the blocks. Please note this is intended for hiding or unhiding text only, not any complicated code fragments or place holders. Notice that the HIDE starts out visible and the UNHIDE starts out commented and invisible. Example usage:

<!-- PICO_T_BEG_HIDE_NOTFOUND -->
You see this as long as there are results
<!-- PICO_T_END_HIDE_NOTFOUND -->


<!-- PICO_T_BEG_UNHIDE_NOTFOUND
You see this only when there are no results
PICO_T_END_UNHIDE_NOTFOUND -->


PICO_RM Codes
We provide these for you to remove default layout behaviors that you may want to override for your classes. To use any one of these codes, just wrap them within HTML comment tags with no arguments. Example usage:
<!-- PICO_RM_CLASS_PICO -->
  • PICO_RM_CLASS_PICO
    PicoSearch results automatically include some "pico..." classes under XHTML compliance (see the option for XHTML/HTML compliance in the "Colors, Fonts & Display" section of your account manager). Default classes are easily overridden by your own using Style Control template codes, but use this if you want to remove all of PicoSearch's default classes.

  • PICO_RM_FONT_TAGS
    Newer accounts get XHTML compliance with no Font tags anyway: see the compliance option in the "Colors, Fonts & Display" section of your account manager. Font tags are deprecated and generally harmless, being easily overridden by style classe. Use this if you keep the older HTML only compliance option and still need to remove Font tags.

  • PICO_RM_TABLE_TAGS
    Use this to remove all table tags from the search results. Because the results are already a simple list, this removal basically just affects the default search box. Removing tables may be needed for mobile devices and other displays that do not show tables well. Of course, other template codes intended for table parts then become invalidated, so it's a drastic option.

  • PICO_RM_IB_TAGS
    Use this to removes all i and b tags (italic and bold), replacing them with em and strong, respectively. This may be a stylistic preference only, since browsers work with either standard, and most people are accustomed to b and i.

Add/Replace Codes
If you want to rearrange the placement of components, such as reorder the default messages or display some messages in a seperate table, PicoSearch provides template codes that serve as location markers for use anywhere in your search results template. We collect and explain this group below.

For each standard message, there is a code for moving that message around. This includes the page bar which contains the links to more results. You can add a code to your template where you want a specific message to appear, and PicoSearch will change it to the actual message if appropriate. Otherwise if the message does not apply, all occurences of that code will be erased. For instance the code for the "not found" message only gets filled in if no results were found in a search, otherwise that code is erased.

Each of these codes start with _PICO_ and end with either _ADDITIONAL or _REPLACEMENT. Use the ADDITIONAL version if you want a message to plug into both the default and your additional locations. Otherwise use the REPLACEMENT version to remove the default message and replace it in your own locations only. Notice that you can remove any message or component entirely by putting the REPLACEMENT code for it within HTML comments. Also see the linked Parts Substitution Codes to customize the wording or style for a particular message. All Parts Substitution Codes start with PICO_TEMPLATE, and are inserted within HTML comment tags in your search results template (we recommend in the <head> section for readability).

  • _PICO_NOTFOUND_ADDITIONAL
    _PICO_NOTFOUND_REPLACEMENT

    Code for the message displayed when no results are returned for a search query, after the user had typed something in the search box (compare with _PICO_EMPTYSEARCH). Default is in the current display language and says: "No documents found relating to your query. Try to widen your search and enter more terms related to your topic." Use PICO_TEMPLATE_NOTFOUND to customize the message.


  • _PICO_EMPTYSEARCH_ADDITIONAL
    _PICO_EMPTYSEARCH_REPLACEMENT

    Code for a custom message displayed when the user hasn't typed any search terms, and consequently there are no results. You must first set the custom message with PICO_TEMPLATE_EMPTYSEARCH, then it can be moved around with the code.


  • _PICO_ONEFOUND_ADDITIONAL
    _PICO_ONEFOUND_REPLACEMENT

    Code for the message displayed when one search result is returned. Default is in the current display language and says: "Found 1 document." Use PICO_TEMPLATE_ONEFOUND to customize the message.


  • _PICO_MULTIFOUND_ADDITIONAL
    _PICO_MULTIFOUND_REPLACEMENT

    Code for the message displayed when multiple results returned. Default is in the current display language and says: "Found _FORMDOCS_TOTAL documents, shown _FORMDOCS_FROM - _FORMDOCS_TO." Notice the placeholders fill in with exact counts. Use PICO_TEMPLATE_MULTIFOUND to customize the message.


  • _PICO_HELPBLOCK_ADDITIONAL
    _PICO_HELPBLOCK_REPLACEMENT

    Code for the entire help message, default is the PicoSearch help advice in the current display language. Use PICO_TEMPLATE_HELPBLOCK to customize the message.


  • _PICO_FOUNDMSG_ADDITIONAL
    _PICO_FOUNDMSG_REPLACEMENT

    Code for the message displayed for the found words. Normally this says "Search:", followed by the query that was typed by the user. Use PICO_TEMPLATE_FOUNDWORD to customize the message. (Also see _PICO_EMPTYSEARCH for the message when no query typed).
    Tip: For complete styling control, use PICO_TEMPLATE_FOUNDWORD with the keyword _FORMQUERY, and include your own tags for setting the style. For instance you can emphasize the query portion within the message by applying a seperate style to it, like a bold font or your own custom CSS class. For this wrap _FORMQUERY in a span like in the following example:
    <!-- PICO_TEMPLATE_FOUNDWORD You searched for: <span style="font-weight:bold;">_FORMQUERY</span>, see results below. -->


  • _PICO_PAGEBAR_ADDITIONAL
    _PICO_PAGEBAR_REPLACEMENT

    Code for the entire page bar, which is the cue of links to more results pages when they are available. The default number of results per page is 10, this can be changed in the account manager's Ranking Options section, or set dynamically per search box with the Initializing FAQ. The default page bar style shows links in the form of [first - last], like [1-10], [11-20], and so on. Use PICO_TEMPLATE_STYLE_PAGEBAR to change the style to Number Per Page or your own Custom List. Also try these template codes for other page bar options:
    PICO_TEMPLATE_MAXLINKS_PAGEBAR to control the maximum number of links displayed before the "Next" link.
    PICO_TEMPLATE_PREVCUE to change the default "Previous" link.
    PICO_TEMPLATE_NEXTCUE to change the default "Next" link.
    PICO_TEMPLATE_RESULTSPAGES_CUE to change the "Results Pages" wording on the bottom page bar, or turn the bottom page bar off entirely.


  • _PICO_ALL_TRY_ANY_ADDITIONAL
    _PICO_ALL_TRY_ANY_REPLACEMENT

    Code for the message displayed when a search in ALL words mode has found no results and ANY words mode has been automatically tried instead. This useful failover behavior is selected in the account manager's Page Design section. Use PICO_TEMPLATE_ALL_TRY_ANY to customize the message.


  • _PICO_SPELL_DIDYOU_ADDITIONAL
    _PICO_SPELL_DIDYOU_REPLACEMENT

    Code for the message displayed when the search query has spelling errors but still finds some results. Default says "Did you mean?", followed by a link to an alternate spell-corrected query to try next. Use PICO_TEMPLATE_SPELL_DIDYOU to customize the message.


  • _PICO_SPELL_CORRFOUND_ADDITIONAL
    _PICO_SPELL_CORRFOUND_REPLACEMENT

    Code for the message displayed when the search query has spelling errors and returns no results, causing PicoSearch to search for an alternative correct spelling which does find results. Default has two lines and says: "_BAD_QUERY => returned no results. _ALT_QUERY => was tried instead, see results below". Notice the placeholders fill in with the actual search queries. Use PICO_TEMPLATE_SPELL_CORRFOUND to customize the message.


  • _PICO_SPELL_CORRNOTFOUND_ADDITIONAL
    _PICO_SPELL_CORRNOTFOUND_REPLACEMENT

    Code for the message displayed when the search query has spelling errors and returns no results, causing PicoSearch to search for an alternative spelling which does not yield any results either. Default says: "_ALT_QUERY was also tried, no results either." Notice the placeholder fills in with the actual alternate query. Use PICO_TEMPLATE_SPELL_CORRNOTFOUND to customize the message.


  • _PICO_IGNORINGMSG_ADDITIONAL
    _PICO_IGNORINGMSG_REPLACEMENT

    When Stopwords are ignored and reported to the user, this code captures the displayed message. This defaults to "Ignoring:" in the current language, followed by a list of the ignored Stopwords. Use PICO_TEMPLATE_IGNORINGWORD to customize the message.
    Tip: For complete styling control, use PICO_TEMPLATE_IGNORINGWORD with the keyword _PICO_IGNORED_WORDS, and include your own tags for setting the style. For instance you can emphasize the ignored words list within the message by applying a seperate style to it, like a bold font or your own custom CSS class. For this wrap _PICO_IGNORED_WORDS in a span like in the following example:
    <!-- PICO_TEMPLATE_IGNORINGWORD Skipping these common word(s): <span style="font-weight:bold;">_PICO_IGNORED_WORDS</span>, see results for remaining words below -->


  • _PICO_SYNONYMMSG_ADDITIONAL
    _PICO_SYNONYMMSG_REPLACEMENT

    When User Synonyms are reported to the user (as selected in the account manager), this code captures the displayed message. This defaults to "synonyms:" for English or an equivalent label for other languages, followed by a list of the synonyms used. Use PICO_TEMPLATE_SYNONYMWORD to customize the message.
    Tip: For complete styling control, use PICO_TEMPLATE_SYNONYMWORD with the keyword _PICO_SYNONYM_WORDS, and include your own tags for setting the style. For instance you can emphasize the synonyms list within the message by applying a seperate style to it, like a bold font or your own custom CSS class. For this wrap _PICO_SYNONYM_WORDS in a span like in the following example:
    <!-- PICO_TEMPLATE_SYNONYMWORD Enriching query with: <span style="font-weight:bold;">_PICO_SYNONYM_WORDS</span>, see results for all below -->


  • _PICO_QUERYMSG_ADDITIONAL
    _PICO_QUERYMSG_REPLACEMENT

    If you are using Query Rules to generate custom alert messages for certain queries, this code captures the message that the query triggered. Be sure to read the FAQ before trying Query Rules in the account manager.


  • _PICO_WITHINMSG_ADDITIONAL
    _PICO_WITHINMSG_REPLACEMENT

    When Within Results sequences are reported to the user (as selected in the account manager's Page Design section), this code captures the displayed message. This defaults to "within results:" in the current language, followed by the previous query sequences. Use PICO_TEMPLATE_WITHINOPT to customize the message.


Back to FAQs