Home > Fluid Dynamics Search Engine > Help > 1103

Customizing HTML: List of all available variables

General Variables:

The following variables can be used in any FDSE template except "line_listing.txt".

Name Value Version*
%copyright%FDSE copyright text.2.0.0.0048
%help_file%The URL to the folder that contains all help files. Defaults to "http://www.xav.com/scripts/search/help/".all
%query_example%A string like "oatmeal cookies", as pulled from the strings.txt file of the current language. Only available for the tips.htm template.2.0.0.0054
%url_query_example%URL-encoded version of query_example, i.e. "oatmeal%20cookies". Only available for the tips.htm template.2.0.0.0054
%realm%Equal to the "Realm" HTML form value.2.0.0.0048
%script_name%The URL of the FDSE search script, as given in the SCRIPT_NAME environment variable.all
%search_url%Same as %script_name%all
%search_url_ex%The URL of the FDSE search script, with all persisted fields appended. For example, if FDSE is called with "p:lang" set to "german" and "p:pm" set to 1, then search_url_ex might equal "/search/search.pl?p:lang=german&p:pm=1&". There will always be a trailing "?" or "&" on this variable, so additional name-value pairs can be added.2.0.0.0054
%terms%Equal to the "Terms" HTML form value. If "Terms" is not defined in the HTML form, but "terms" or "q" are defined there, then "Terms" will take on the value of one of the aliased names.2.0.0.0048
%terms%Equal to the "Terms" HTML form value. If "Terms" is not defined in the HTML form, but "terms" or "q" are defined there, then "Terms" will take on the value of one of the aliased names.2.0.0.0048
%terms_url%URL-encoded version of "terms" variable. Used in creating links.2.0.0.0054
%lang_options%A set of tags like <option value="english">English</option>. Used in allowing visitor to select an interface language from one of the installed packages.2.0.0.0056
%language%The selected language, such as "german", "english", "tr".2.0.0.0064

* "Version" indicates the first FDSE version for which this variable is defined, or behaves in the way described.

See also: Customizing HTML: How to use variables in templates


Variables for the line_listing.txt Template

The following variables can be used in your "line_listing.txt" template. This template is used for each search result in the search results list:

Name Value Version*
%admin_options%A set of links which appear only in admin mode; includes Edit, Crawl, and Delete commands.all
%context%A set of phrases from the document text, which show one or more search terms in context. This value is only populated if the User Interface Setting "Show Examples: Enable" has been set, and if sufficient example text has been found. The actual search terms will be highlighted by the B.hl2 CSS class.2.0.0.0033
%context_line%If %context% is non-empty, then this variable is equal to <br /><b>$::str[35]:</b> $pagedata{'context'} which is <br /><b>Excerpt:</b> $pagedata{'context'} in English.2.0.0.0033
%dd%
%day%
Day of the month for the last modified time of the document in this record.all
%description%String description of the document, pulled from the description META tag or the first few words of the document. Search terms occurring within the description will be highlighted using the B.hl1 CSS class.all
%file_type_icon%A short string describing the file type, if binary. See Displaying file-type icons in search results.2.0.0.0064
%host%The hostname portion of the URL, i.e. "www.xav.com" for URL "http://www.xav.com/index.html". Will be an empty string if the hostname cannot be parsed.2.0.0.0033
%mm%Integer month index (ranging from 0 to 11 for Jan to Dec) for the last modified time of the document in this record.all
%month%Month, expressed as a string like "Jan" or "Dec", for the last modified time of the document in this record.all
%rank%Integer ranking of this search result within the set of all search results. Range of 1 to N, with 1 being highest rank.all
%realm%Equal to the "Realm" HTML form value.2.0.0.0048
%record_realm%The FDSE Realm that contains this document. This value is always null when MySQL is used for data storage. Compare with the %realm% variable.2.0.0.0050
%redirector%The URL to a CGI script that logs click-throughs. Typically equal to the value of the General Setting "Redirector", which defaults to null. The URL should include any trailing "?" if defined. This variable is used to route actual clicks through a logging script, without exposing that fact to the user, i.e. <a href="%redirector%%url%">%url%</A>all
%relevance%The numeric relevance value of this search result. This is an integer ranging from 0 to 1 000 000. See Sorting Results: How relevance is calculated.2.0.0.0049
%script_name%
%search_url%
The URL of the FDSE search engine. See Customizing HTML: Adding "Other Pages from This Site" to Result List for an example of using this variable.2.0.0.0030
%size%String representation of document size. Documents smaller than 1500 bytes will show exact size, ex "1120 bytes". Larger files will show their kilobyte size, rounded down to the nearest kilobyte, ex "20 kb".all
%target%Always set to a null string. For compatibility with "line_listing.txt" files distributed with FDSE 0032 and earlier.2.0.0.0033
%terms%Equal to the "Terms" HTML form value. If "Terms" is not defined in the HTML form, but "terms" or "q" are defined there, then "Terms" will take on the value of one of the aliased names.2.0.0.0048
%title%String title of the document, pulled from the TITLE HTML tag or the file name.all
%url%
%html_url%

The HTML-encoded URL of the document. Example:

http://xav.com/?a=b&1=2

will be encoded as:

http://xav.com/?a=b&amp;1=2

Intended for use in HREF attributes.

all
%url_url%

The URL-encoded URL of the document. Example:

http://xav.com/?a=b&x=y

will be encoded as:

http%3A//xav.com/%3Fa%3Db%26x%3Dy

Intended for passing the URL as a parameter to another script, such as a click-through logger or the proxy.pl tool.

all
%year%
%yyyy%
Integer four-digit year for the last modified time of the document in this record.all

* "Version" indicates the first FDSE version for which this variable is defined, or behaves in the way described.

* Note that the last modified time and last index time are equivalent for records where the true last modified time is unknown. See Calculating last-modified time for more information about limitations in measuring the true last-modified time.


    "Customizing HTML: List of all available variables"
    http://www.xav.com/scripts/search/help/1103.html