Help with PicoSearch
>
FAQs
>
New Features
>
What is PicoSearch?
>
PicoSearch Glossary
>
Sample Customers
>
License
Search our Site
Search the FAQs
What codes can I use in my template to further customize my search results?
Your engine's search results page is designed by you in the "Customize Template" section of your account manager. This allows you to match the look and feel of your website so the search results appear perfectly integrated. Your template specifies where the search results appear within your design, and these results are generated by PicoSearch based on the user's search query. Several essential settings for the search results themselves can be found in the "Page Design" and "Colors and Fonts" sections of your account manager. For more advanced adjustments, PicoSearch provides the following codes to embed in your template. They come in three flavors:
1)
General Substitution
, 2)
Parts Substitution
, and 3)
Layout Control
.
1. General Substitution: PICOCALLER
This first code is the most general, and it will give you some context dependency depending on your calling page. It is not recommended as a substitute for completely different templates, which are truly supported only by separate accounts.
Any occurence of the keyword _PICOCALLER in your template will be replaced with the value of the argument "picocaller" in your PicoSearch calling code. That is, if you add the following line to your search box code:
<input type="hidden" name="picocaller" value="1" />
Then a graphic in your template with the file name of "button_PICOCALLER.gif" will become button1.gif, and you will have the opportunity to show a different button image to reflect the calling page of the search. If the picocaller argument is not set, then all occurences of _PICOCALLER will simply be erased, and the button.gif graphic would be in used in the example case.
If you need more than one _PICOCALLER plugin value, there are also _PICOCALLER0, _PICOCALLER1, ... _PICOCALLER9. These are replaced in the same way by args picocaller0 through picocaller9.
2. Parts Substitution: TEMPLATE codes
Below is a list of template codes that replace specific parts of the PicoSearch search results, allowing you to control primarily the standard phrases. They are in the style of HTML commented lines, so that you can develop your template without them being visible. In practice, they will be mined and stripped from your final search results display, so no one will know, even in the source code, that PICO custom codes were utilized. We suggest that you put them in the head of your template, as you would for meta tags.
PICO_T_BEG_HIDE_NOTFOUND etc.
Message hiding or unhiding for no results. 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_TEMPLATE_NOTFOUND
Message for no results when the user has definitely typed something (compare with PICO_TEMPLATE_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." To turn this message off entirely, use this template code with a non breaking space character, like the following:
<!-- PICO_TEMPLATE_NOTFOUND   -->
Note that a nice customization here can be a link to more help or a customer support email, and there is a super trick to put the query in the email subject automatically! Example usage:
<!-- PICO_TEMPLATE_NOTFOUND <b>We could not find a match for you.</b><br>Please try again or <a href="mailto:support@mysite.com?Subject=Help! I couldn't find: _FORMQUERY">contact customer service</a> -->
PICO_TEMPLATE_ONEFOUND
Message for 1 result, default is in the current display language and says "Found 1 document." A value of 'none' will turn this message off entirely. Example usage:
<!-- PICO_TEMPLATE_ONEFOUND Just one match was found. -->
PICO_TEMPLATE_MULTIFOUND
Message for multiple results, default is in the current display language and says "Found _FORMDOCS_TOTAL documents, shown _FORMDOCS_FROM - _FORMDOCS_TO." Note the use of placeholders for exact counts. A value of 'none' will turn this message off entirely. Example usage:
<!-- PICO_TEMPLATE_MULTIFOUND Found _FORMDOCS_TOTAL matches, showing match _FORMDOCS_FROM to _FORMDOCS_TO below. -->
PICO_TEMPLATE_EMPTYSEARCH
Message for when the user hasn't typed any search terms, and consequently there are no results. This will override the default behavior of acting neutral by saying just the found word label with no terms after (see also PICO_TEMPLATE_FOUNDWORD). This also overrides the one-click entrance message if you're calling the one-click entrance (see that feature in your account manager). Example usage:
<!-- PICO_TEMPLATE_EMPTYSEARCH <b>Don't be shy, give search a try!</b> -->
PICO_TEMPLATE_BOXSIZE
Search box width, default is 25. Example usage:
<!-- PICO_TEMPLATE_BOXSIZE 15 -->
PICO_TEMPLATE_BUTTONTEXT
Search button text, default is "Search" in the current language. Example usage:
<!-- PICO_TEMPLATE_BUTTONTEXT Fetch! -->
PICO_TEMPLATE_ANYOPT
The text for the option to Find ANY word. Example usage:
<!-- PICO_TEMPLATE_ANYOPT Search for any of my words -->
PICO_TEMPLATE_ALLOPT
The text for the option to Find ALL words. Example usage:
<!-- PICO_TEMPLATE_ALLOPT Search for all of my words -->
PICO_TEMPLATE_EXACTOPT
The text for the option to Find EXACT phrase. Example usage:
<!-- PICO_TEMPLATE_EXACTOPT Search for my phrase exactly -->
PICO_TEMPLATE_WITHINOPT
The text for the option to search Within Results. Example usage:
<!-- PICO_TEMPLATE_WITHINOPT within the previous search results -->
PICO_TEMPLATE_FOUNDWORD
The default text for the label on the words found. Normally this is the same 'Search' word as in the seach button, but it becomes the Partition name if search is within a Partition. Setting this option can make the text differ from the button. A value of 'none' will turn the searched words line off. Example usage:
<!-- PICO_TEMPLATE_FOUNDWORD Found -->
PICO_TEMPLATE_IGNORINGWORD
When
Stopwords
are ignored and reported to the user, this template code sets the label which defaults to "Ignoring" in the current language. Example usage:
<!-- PICO_TEMPLATE_IGNORINGWORD Skipping noise words -->
PICO_TEMPLATE_SYNONYMWORD
When User Synonyms are reported to the user (as selected in the account manager), this template code sets the label for the added word(s). This is useful if the current label is not what you would prefer in your language. Example usage:
<!-- PICO_TEMPLATE_SYNONYMWORD Enriching query with -->
PICO_TEMPLATE_HELPWORD
Help link text, default is "Help" in the current language. Example usage:
<!-- PICO_TEMPLATE_HELPWORD Suggestions for searching -->
PICO_TEMPLATE_HELPBLOCK
Entire help message, default is the PicoSearch help advice in the current display language. Example usage :
<!-- PICO_TEMPLATE_HELPBLOCK <b>How to Search our Catalog</b><br>Type the parts numbers or relevant terms and we will find the page for you. -->
PICO_TEMPLATE_PREVCUE
Previous search batch cue, default is "Previous" in the current display language. Example usage:
<!-- PICO_TEMPLATE_PREVCUE Back -->
PICO_TEMPLATE_NEXTCUE
Next search batch cue, default is "Next" in the current display language. Example usage:
<!-- PICO_TEMPLATE_NEXTCUE More Results -->
PICO_TEMPLATE_LISTONLY
Turn off search box and status bar, show only raw results list. Example usage:
<!-- PICO_TEMPLATE_LISTONLY -->
PICO_TEMPLATE_HR_1
Substitute the following text for the first hard rule line commonly used in the search results. The value "none" will turn the <hr> tag off. Codes for _HR_2 and _HR_3 work identically for the second and third hard rule lines. Example usage:
<!-- PICO_TEMPLATE_HR_2 **** your results are below **** -->
PICO_TEMPLATE_RESULTSPAGES_CUE
Replace the "Results Pages:" cue that appears at the end of the results list when there are more results pages available. Example usage:
<!-- PICO_TEMPLATE_RESULTSPAGES_CUE <hr>More Results: -->
PICO_TEMPLATE_SORTBY
When date sorting is offered, use this phrase instead of "Sort by". Example usage:
<!-- PICO_TEMPLATE_SORTBY Filter in order of -->
PICO_TEMPLATE_RELEVANCYWORD
When date sorting is offered, use this word(s) instead of the word "relevancy". Example usage:
<!-- PICO_TEMPLATE_RELEVANCYWORD goodness for you -->
PICO_TEMPLATE_DATEWORD
When date sorting is offered, use this word(s) instead of the word "date". Example usage:
<!-- PICO_TEMPLATE_DATEWORD chronological metric -->
PICO_TEMPLATE_POSTSORTBY
When date sorting is offered, use this phrase after the phrase "Sort by relevancy/date". Especially needed for languages that require some post-syntax, such as German "Nach datum sortieren". Example usage:
<!-- PICO_TEMPLATE_POSTSORTBY of documents -->
PICO_TEMPLATE_ICONPDF
When displaying the icon for PDF documents, use this graphic instead. Be sure to quote the full URL to your icon starting with http. The default size for the icons is 16 by 16, so follow the URL height and width if yours differs. If you don't want any icon, use the code with no arguments. Example usage:
<!-- PICO_TEMPLATE_ICONPDF "http://www.mysite.com/images/pdficon.gif" height="20" width="20" -->
Refer to the Additional File Formats section of your account manager for the list of file types and their icons. Template codes for other types work the same way starting with PICO_TEMPLATE plus: _ICONSHOCKWAVE, _ICONXML, _ICONMP3, _ICONMIDI, _ICONMSWORD, _ICONMSEXCEL, _ICONMSPOWERPOINT, _ICONRTF, _ICONPS, and _ICONTEXT
PICO_TEMPLATE_LINKPIC
If you want to show an image next to certain results, you can use the
PICOLINKPIC
tag in each file that gets the image. But if you have a common image for many files, you can use put the file patterns in your template with each link picture. The syntax is the same as the PICOLINKPIC tag, so read
that FAQ
first. An additional argument PATTERN takes a quoted list of space-separated patterns, similar to the patterns you use for Excluded Paths or Partitions. The patterns are case-insensitive and match left to right with an implied final wildcard, so a directory can match all contents, or if you include any wildcards then the pattern must match the entire url for the image to be displayed. You can have as many as you like in your template, just be aware that a file's own hardcoded PICOLINKPIC will take precedence, and not more than one image will be displayed.
Here's an example usage with pattern string to match everything in a certain directory plus all of the search engine's pdfs, with the image linking to the particular file in the search results:
<!-- PICO_TEMPLATE_LINKPIC="http://www.mysite.com/pageicon.gif" PATTERN="http://mysite.com/directoryfiles/ *.pdf" -->
And here's the same example showing the optional attributes for image alt and border style, as well as a forced common href (to a single signup page perhaps) and target:
<!-- PICO_TEMPLATE_LINKPIC="http://www.mysite.com/pageicon.gif" width="30" height="25" alt="description" style="border:1;" href="http://www.mysite.com/signup.html" target="_blank" PATTERN="http://mysite.com/directoryfiles/ *.pdf" -->
3. Layout Control: CSS CLASS and related codes
Below is a list of template codes that focus on controlling layout, mostly by assigning Cascading Style Sheet classes to components of the search results. Some related codes are presented first to remove default layout behaviors that you may want to override for your classes. By assigning your own class names, you can control display variables that are not otherwise controllable, such as the background color of the text input box. Other codes perform related functions like removing tags that CSS supercedes.
Like the template codes, the class codes are in the style of HTML commented lines, so that you can develop your template without them being visible. In practice, they will be mined and stripped from your final search results display, so no one will know, even in the source code, that PICO custom codes were utilized. We suggest that you put them in the head of your template, as you would for meta tags.
There are many class codes to set the class for each of the many individual pieces you may wish to modify. Use only the ones that interest you. As an example:
<!-- PICO_CLASS_INPUT_SEARCH searchboxclass -->
This class code makes the search input box get
class=searchboxclass
added to its input tag attributes:
<input type="text" class="searchboxclass" name="query" size="40" />
So then the following CSS definition, for example, would make the search box pink and italic:
<style> <!-- .searchboxclass {background:pink; font-style:italic} --> </style>
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 PICO_CLASS template codes below, but if you want to remove all of PicoSearch's default classes then use the PICO_RM_CLASS_PICO comment with no argument.
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. If you keep the older HTML only compliance option and still need to remove Font tags, use the PICO_RM_FONT_TAGS comment with no argument. Font tags are deprecated and generally harmless, being easily overridden by style classes.
PICO_RM_TABLE_TAGS
With no argument, this comment removes 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
With no argument, this comment 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.
PICO_CLASS_TABLE_ALL
set the class of table containing the entire results
Note:
Usage of this code may override the Font Face and Width of Results settings from your account manager's "Colors, Fonts & Display" and "Page Design" sections. If you use this template code, be sure to specify your desired overall font face and results width in your CSS class.
PICO_CLASS_TABLE_SEARCH
set the class of table containing the search box
PICO_CLASS_INPUT_SEARCH
set the class of text input for the search box
PICO_CLASS_TD_SEARCH
set the class of column containing the search box
PICO_CLASS_INPUT_BUTTON
set the class of the search button
PICO_CLASS_TD_BUTTON
set the class of column containing the search button
PICO_CLASS_INPUT_WITHIN
set the class of checkbox for 'within results' option
PICO_CLASS_TD_WITHIN
set the class of column containing 'within results' option
PICO_CLASS_TD_HELP
set the class of column containing the help link
PICO_CLASS_A_HELP
set the class of help link
PICO_CLASS_A_PICO
set the class of 'powered by picosearch' link
PICO_CLASS_SELECT_PARTITION
set the class of partition select box
PICO_CLASS_TD_PARTITION
set the class of column containing partition select box
PICO_CLASS_SELECT_ANYALL
set the class of any/all/exact select box
PICO_CLASS_TD_ANYALL
set the class of column containing any/all/exact select box
PICO_CLASS_SELECT_DATESORT
set the class of date sorting selection
PICO_CLASS_TD_DATESORT
set the class of column containing date sorting selection
PICO_CLASS_TD_NOTFOUND
set the class of column containing 'not found' message
PICO_CLASS_SPAN_SEARCHLABELS
set the class of span containing the labels for the last search (eg. Search, ignoring )
PICO_CLASS_SPAN_TERMS
set the class of span containing the words of last search
PICO_CLASS_SPAN_NUMDOCS
set the class of span containing the reported number of documents found
PICO_CLASS_A_PREVNEXT
set the class of previous and next links for more than one page of results
PICO_CLASS_HR_1
set the class of first hard rule line, after the search box
PICO_CLASS_HR_2
set the class of second hard rule line, before the results
PICO_CLASS_HR_3
set the class of third hard rule line, after the results
PICO_CLASS_OL
set the class of ordered list of results
PICO_CLASS_A_TITLE
set the class of title links of results
PICO_CLASS_SPAN_TITLE
set the class of spans containing the linked titles of results
PICO_CLASS_SPAN_CONC
set the class of spans containing the concordance of results
PICO_CLASS_SPAN_META
set the class of spans containing the meta description of results
PICO_CLASS_SPAN_TITLEHITS
set the class of spans containing the hit words in result titles (normally bolded)
PICO_CLASS_SPAN_CONCHITS
set the class of spans containing the hit words in result concordances (normally bolded)
PICO_CLASS_SPAN_METAHITS
set the class of spans containing the hit words in result meta descriptions (normally bolded)
PICO_CLASS_SPAN_URL
set the class of spans containing the URLs of results
PICO_CLASS_SPAN_DATESIZE
set the class of spans containing file date and file size
PICO_CLASS_SPAN_HELP
set the class of spans containing the help text, seen from the help link
PICO_CLASS_TABLE_HELP
set the class of table of help examples, seen from the help link
Patents Pending. Copyright © PicoSearch LLC