12.4 Global Template Variables

Global template variables can be used in any of the QuickFinder templates.

For more information about how to implement variables in a template, see Section 13.0, Customizing Your Templates and Search Forms.

Table 12-1 Global Template Variables

Name

Description

$$Authenticated

Indicates whether or not the user is authenticated by returning either a 1 (True) or 0 (False).

$$BeginAuthenticated

Begins a section for a valid, logged-in user. If a user is authenticated, the text between the begin and end tags is processed and appears in the output. If a user is not authenticated, the text is removed from the search results page. To control the appearance of unauthenticated search results, see $$BeginUnAuthenticated.

See also $$EndAuthenticated.

$$BeginBestBetIndexesLoop

Begins a repeating section that lists best bet indexes used to produce the best bets search results list. This section is repeated for each best bet index.

See also $$EndBestBetIndexesLoop.

$$BestBetIndex[number]

Names of the best bets indexes the user specified in the search query. If the optional number is not provided, the value of $$BestBetIndexesCurrent is used.

See also $$BeginBestBetIndexesLoop.

$$BestBetIndexesCount

Number of best bets indexes associated with the user query.

See also $$BeginBestBetIndexesLoop.

$$BestBetIndexesCurrent

Number of the current best bets index.

See also $$BeginBestBetIndexesLoop.

$$BestBetNum

Total number of best bets results to display at a time.

$$BestBetShow

Returns True or False, depending on QuickFinder Server Manager’s Search Settings page. To override the default, use the &bbshow= true | false query parameter.

$$BeginExpandIndexesLoop

Begins a repeating section that shows the search expansion indexes used if the primary indexes do not find any search results. This section is repeated for each search expansion index.

$$BeginFiltersLoop

Begins a repetitive section that is processed for each filter parameter associated with the current query item. Multiple query items can be sent as part of a single query. See also $$EndFiltersLoop.

$$BeginIndexesLoop

Begins a repetitive section that is processed for each index the user specified in the search query.

See also $$EndIndexesLoop and $$QueryIndex[number].

$$BeginLogin

Begins a section of code used to define a login form that the user can use to log in.

This section is processed only if the &login=true query parameter is included with the QuickFinder request.

$$BeginLoop

End of the header section. Beginning of the repeating body section. This section is repeatedly parsed until there are no further result items to process.

See also $$EndLoop.

$$BeginNoLogin

Informs users that the current search form does not require a login. Typically, this section is followed by a login button that users can click to receive a login form, which comes from the $$BeginLogin variable.

If no login query parameter is passed to the server, then everything between this variable and $$EndNoLogin is returned to the user.

See also $$EndNoLogin.

$$BeginQueryLoop

Begins a repetitive section that is processed for each query item associated with the current search query. See $$NumQueryItems for more information.

See also $$EndQueryLoop.

$$BeginReturnFieldsLoop

Begins a repetitive section that is reprocessed for each return field the user specified in the search query.

See also $$QueryReturnField[number].

$$BeginSortKeysLoop

Begins a repetitive section that is processed for each sort key the user specified in the search query.

See also $$EndSortKeysLoop and $$SortKeysCurrent.

$$BeginUnAuthenticated

Begins a section for an unrecognized or logged-out user. Used in conjunction with $$EndUnAuthenticated. If a user is not recognized, the text between these two tags is processed and appears in the output. If the user is recognized as a valid, logged-in user, this text does not appear in the output.

To control the appearance of authenticated search results, see $$BeginAuthenticated.

$$Counter[variable_number, increment_number]

Inserts the value of the specified variable_number counter into the search result page. All counters initialize to zero. The optional second parameter specifies the amount to increment or decrement the current value. A maximum of 10 counters is supported.

For example:

$$Counter[1] = insert value of counter #1

$$Counter[1,1] = increment counter #1 by 1 and display the new value

$$Counter[5,-3] = decrement counter #5 by 3 and display the new value

$$DefaultQueryEncoding

Default encoding of the user query if not specified by using the &encoding= query parameter.

$$EndAuthenticated

Ends a section for a valid, logged-in user.

See also $$BeginAuthenticated.

$$EndBestBetIndexesLoop

Closes the $$BeginBestBetIndexesLoop, which lists the best bets indexes used to produce the best bets results list.

See also $$BeginBestBetIndexesLoop.

$$EndExpandIndexesLoop

Ends the $$BeginExpandedIndexesLoop section, which is used to get a list of search expansion indexes used by the current query.

See also $$BeginExpandIndexesLoop.

$$EndFiltersLoop

Ends a repetitive section that is processed for each filter parameter associated with the current query item.

See also $$BeginFiltersLoop.

$$EndIndexesLoop

Ends a repetitive section that is processed for each index the user specified in the search query.

See also $$BeginIndexesLoop and $$QueryIndex[number].

$$EndLogin

Closes the $$BeginLogin section, which is used to produce a login form.

See also $$BeginLogin.

$$EndLoop

End of the repeating body section. Beginning of the footer section.

$$EndNoLogin

Closes the $$BeginNoLogin section, which is used to specify that the user is not currently logged in. This section appears when no login parameter is passed to the server.

See also $$BeginNoLogin.

$$EndQueryLoop

Ends a repetitive section that is processed for each query item associated with the current search query. See $$NumQueryItems for more information.

See also $$BeginQueryLoop.

$$EndReturnFieldsLoop

End of a repetitive section that is reprocessed for each return field the user specified in the search query.

See also $$QueryReturnField[number].

$$EndSortKeysLoop

Ends a repetitive section that is processed for each sort key the user specified in the search query.

See also $$BeginSortKeysLoop and $$SortKeysCurrent.

$$EndUnAuthenticated

Ends a section for an unrecognized or logged-out user. For more information, see $$BeginUnAuthenticated.

$$ExpandIndexesCount

Number of search expansion indexes associated with the user query.

See also $$BeginExpandIndexesLoop.

$$ExpandIndexesCurrent

Number of the current search expansion index.

See also $$BeginExpandIndexesLoop.

$$FilterCount

Number of filters associated with the current query item. Multiple query items can be associated with a single query.

$$FilterCurrent

Number of the current filter associated with the current query item.

$$FilterOperator

Boolean operator used to join the filters associated with the current query item. The full set of filters is always joined to the current query item using the Boolean AND.

$$FilterValue[number]

Pulls the value of the specified filter associated with the current query item. If the optional # parameter is not provided, the current filter loop value ($$FilterCurrent) is used.

$$HostURL

Generates the current URL up to, and including, the optional port number.

$$IncludeFile[template_name]

Automatically pulls in the designated template at the location of this variable. The included template can contain other template variables, which are processed as though they were a part of the original template. The template name parameter can be either a full FILE:// URL based on the file system of the server or a relative path based on the location of the parent template. The template name parameter can be located within quotation marks. See the ResultListTemplate.html file for an example use of this variable.

$$IndexesCount

Number of indexes associated with the user query.

See also $$BeginIndexesLoop.

$$IndexesCurrent

Number of the current index.

See also $$BeginIndexesLoop.

$$IsInvalidLogin[text]

If a user’s login is invalid, the text contained between the brackets is returned to the user. A typical message might be Invalid login. Please try again.

$$NumQueryItems

Number of query items contained within the current query. Although most queries use only one query item, it is possible to construct a query with multiple search criteria, each weighted with a value between 1 and 100. The resulting search contains hits from each of the queries, but the search results are organized with the most relevant hits first (from any of the individual queries).

$$Query[number]

Query specified by the client in the search field. The optional number identifies the corresponding query item. The value of $$QueryCurrent is used if the optional number is not provided.

See also $$NumQueryItems for more information.

$$QueryCount

Number of query items associated with the search query.

See also $$NumQueryItems.

$$QueryCountry

The country requested by the client. This must be an uppercase, two-character value as specified in ISO 3166-1.

$$QueryCurrent

Number of the current query item. See $$NumQueryItems for more information.

See also $$BeginQueryLoop.

$$QueryDate

Begin date requested by the client. Only those documents dated on or after the specified date are returned in the search results. See the query parameter date for more information.

$$QueryEncoding

Actual encoding used to interpret the query. This can be the same as the $$DefaultQueryEncoding, the value of the &encoding= query parameter, or UTF-8.

$$QueryExpandIndex[number]

Names of the search expansion indexes the user specified in the search query. If the optional number is not provided, the current value of $$ExpandIndexesCurrent is used.

See also $$BeginExpandIndexesLoop.

$$QueryFileFilter

Returns the filename filter associated with the user query.

$$QueryIndex[number]

Names of the indexes the user specified in the search query. If the optional number is not provided, the current value of $$IndexesCurrent is used.

See also $$BeginIndexesLoop.

$$QueryLanguage

Language requested by the client. This must be a lowercase, two-character value as specified in ISO 639.

$$QueryNumHits

Number of search results requested by the client.

$$QueryOperator

The type of the current search:

  • 0 = Boolean AND search
  • 1 = Boolean OR search
  • 2 = phrase search

$$QueryReturnField[number]

Name of the return fields the user specified in the search query. If the optional number is not provided, the current value of $$ReturnFieldsCurrent is used.

See also $$BeginReturnFieldsLoop and $$EndReturnFieldsLoop.

$$QueryServerName[text]

Identifies the name of the Virtual Search Server provided with the &server= query parameter. The optional text parameter can be provided in the following formats:

$$QueryServerName = NameOfServer

$$QueryServerName[text] = text NameOfServer

$$QueryServerName[%text] = text URLEncodedNameOfServer

$$QueryServerName[text $$QueryServerName text] = text NameOfServer text

$$QueryServerName[%text $$QueryServerName text] = text URLEncodedNameOfServer text

See also $$ServerName.

$$QuerySynonymFlag

Set to either True or False based on the current setting on QuickFinder Server Manager’s General Settings page. See Using Synonyms to Broaden Search Results for information about enabling synonym-enhanced searching.

$$QueryTemplate

Template name requested by the client.

See also $$TemplateName.

$$QueryTemplateTheme

Template theme requested by the client. This is not necessarily the theme of the search result because the specified theme might not exist.

See also $$TemplateTheme.

$$QueryVersion

Version number of the current query format.

$$QueryWeight[number]

Weighting of the current query item, 1 to 100. If number is not specified, the value of $$QueryCurrent is used. See $$NumQueryItems for more information.

$$ResultEncoding

Encoding used to return the current search results page. This is either the value of the valid &retencoding=query parameter or the default specified by the search administrator in the QuickFinder Server Manager.

$$ReturnField[number]

Name of the return fields the user specified in the search query. If the optional number is not provided, the value of $$ReturnFieldsCurrent is used.

See also $$BeginReturnFieldsLoop and $$EndReturnFieldsLoop.

$$ReturnFieldsCount

Number of return fields specified in the search query.

See also $$BeginReturnFieldsLoop.

$$ReturnFieldsCurrent

Number of the current iteration of the $$BeginReturnFieldsLoop.

$$SearchFor[number]

Query entered by the client into the search field. If the optional number is not provided, the value of $$QueryCurrent is used. See $$Query[number] for more information.

$$ServerName

Name of the virtual search server that produced the current output.

See also $$QueryServerName[text].

$$ServerLocation

Path on the network server to the virtual search server configuration files and indexes.

$$SortField[number]

The name of the field to sort on. If the optional number is not provided, the value of $$SortKeysCurrent is used. See $$SortByURL[sortfield.sortorder ...] and the query parameter sortorderquery_number for more information.

$$SortKeysCount

Number of sort keys associated with the current query.

$$SortKeysCurrent

Current sort keys number. See $$BeginSortKeysLoop for more information.

$$SortOrder[number]

Method of sorting the field (ascending, descending, and default). If the optional number is not provided, the value of $$SortKeysCurrent is used. See $$SortOrder[number] for more Information.

$$TemplateExt

Filename extension of the template currently displayed in the browser.

When an error occurs, QuickFinder automatically attempts to find an error message template that matches the filename extension of the requested search template.

$$TemplateLocale

Locale of the template, such as zh_TW. The locale information is taken from the template filename.

$$TemplateName

Filename of the template currently displayed in the browser.

See also $$QueryTemplate.

$$TemplateTheme

Theme (or theme directory) that the current template belongs to.

See also $$QueryTemplateTheme.

$$UserID

The User ID corresponding to the user who is currently logged in.