Global Template Variables

Global template variables are ones that can be used in any of the Web Search templates.


Table 10. Global Template Variables

Variable Name Description

$$Authenticated

Indicates whether or not the user is authenticated by returning either a 1 or 0.

$$BeginAuthenticated

Begins a section for a valid, logged in user. Used in conjunction with $$EndAuthenticated. If a user is authenticated, the text between these two tags will be processed and appear in the output. If a user is not authenticated, the text will be removed from the search result. To control the appearance of unauthenticated search results, see $$BeginUnAuthenticated.

$$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.

$$BeginIndexesLoop

Begins a repetitive section that will be processed for each index the user specified in the search query. See also $$EndIndexesLoop and $$QueryIndex[number].

$$BeginFiltersLoop

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

$$BeginQueryLoop

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

$$BeginReturnFieldsLoop

The beginning of a repetitive section that will be reprocessed for each return field the user specified in the search query. See also $$QueryReturnField[number].

$$BeginSortKeysLoop

Begins a repetitive section that will be 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 will be processed and appear in the output. If the user is recognized as a valid, logged-in user, this text will 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 var# 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 user query if not specified using the &encoding= query parameter.

$$EndAuthenticated

Ends a section for a valid, logged in user. For more information, see $$BeginAuthenticated.

$$EndFiltersLoop

Ends a repetitive section that will be processed for each filter parameter associated with the current query item. See also $$BeginFiltersLoop.

$$EndIndexesLoop

Ends a repetitive section that will be processed for each index the user specified in the search query. See also $$BeginIndexesLoop and $$QueryIndex[number].

$$EndLoop

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

$$EndQueryLoop

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

$$EndReturnFieldsLoop

The end of a repetitive section that will be reprocessed for each return field the user specified in the search query. See also $$QueryReturnField[number].

$$EndSortKeysLoop

Ends a repetitive section that will be 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 the description for the $$EndUnAuthenticated variable.

$$FilterCount

Identifies the number of filters associated with the current query item. Note that multiple query items can be associated with a single query.

$$FilterCurrent

Identifies the number of the current filter associated with the current query item.

$$FilterOperator

Identifies the 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.

$$IncludeFile[template_name]

Automatically pulls in the designated template at the location of this variable. The included template can contain other template variables, which will be processed as though they were a part of the original template. The template name parameter can either be 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 SearchResultTemplate.html file for an example use of this variable.

$$IndexesCount

The number of indexes associated with the user query. See also $$BeginIndexesLoop.

$$IndexesCurrent

The number of the current index. See also $$BeginIndexesLoop.

$$NumQueryItems

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

$$Query[number]

Query specified by the client into 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

The number of query items associated with the search query. See also $$NumQueryItems for more information.

$$QueryCountry

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

$$QueryCurrent

The number of the current query item. See $$NumQueryItems for more information. See also $$BeginQueryLoop.

$$QueryDate

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

$$QueryEncoding

Actual encoding used to interpret the query (this could be either the same as the $$DefaultQueryEncoding, the value of the &encoding= query parameter, or UTF8).

$$QueryFileFilter

Returns the filename filter associated with the user query.

$$QueryIndex[number]

The 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

The language requested by the client. Note that this must be a lowercase, two-character value as specified in ISO 639.

$$QueryNumHits

The 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]

The 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.

$$QueryTemplate

The template name requested by the client. See also $$TemplateName.

$$QueryTemplateTheme

The template theme requested by the client. This is not necessarily the theme of the search result since the specified theme may not exist. See also $$TemplateTheme.

$$QueryVersion

The version number of the current query format.

$$QueryWeight[number]

The weighting of the current query item 1-100. See $$NumQueryItems for more information.

$$ResultEncoding

Identifies the 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 NetWare Web Search Manager.

$$ReturnField[number]

The name of the return fields the user specified in the search query. If the optional number is not provided, the value of $$ReturnFieldsCurrent will be used. See also $$BeginReturnFieldsLoop and $$EndReturnFieldsLoop.

$$ReturnFieldsCount

The number return fields specified in the search query. See also $$BeginReturnFieldsLoop.

$$ReturnFieldsCurrent

The 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 will be used. See $$Query[number] for more information.

$$ServerName

The 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 will be used. See $$SortByURL[sortfield.sortorder ...] and the query parameter sortfieldnumber for more information.

$$SortKeysCount

The number of sort keys associated with the current query.

$$SortKeysCurrent

The current sort keys number. See $$BeginSortKeysLoop for more information.

$$SortOrder[number]

The order to sort the field (ascending, descending, and default). If the optional number is not provided, the value of $$SortKeysCurrent will be used. See $$SortOrder[number] for more Information.

$$TemplateLocale

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

$$TemplateName

Identifies the filename of the template currently displayed in the browser. See also $$QueryTemplate.

$$TemplateTheme

Identifies the theme (or theme directory) that the current template belongs to. See also $$QueryTemplateTheme.



Previous | Next