"Fossies" - the Fresh Open Source Software Archive

Member "mnogosearch-3.4.0/doc/msearch-cmdref-replacevar.html" (2 Dec 2013, 6640 Bytes) of package /linux/www/mnogosearch-3.4.0.tar.gz:


Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. Alternatively you can here view or download the uninterpreted raw source code. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

ReplaceVar

Name

ReplaceVar -- creates or modifies a variable

indexer.conf

search.htm

Synopsis

ReplaceVar {name} {value}

Creates a variable with the given name and value, for further use in other indexer.conf or search.htm commands, or as a search.htm template variable.

If the variable has previously been created with another ReplaceVar or ImportEnv command, then its old value is replaced.

The value parameter can reference to other variables previously created by ReplaceVar or ImportEnv commands using $(name) syntax.

Variables created using ReplaceVar are considered to have the character set with the one specified in LocalCharset. When being displayed in search template, variable values are converted to BrowserCharset.

ReplaceVar can also be used to set search query parameters in search.htm, without having to pass them in CGI query string. This example sets sorting order to title, like if the s=s&su=title parameters would have been passed in CGI query string:


ReplaceVar s s
ReplaceVar su title
    

Note: ReplaceVar has higher precedence over CGI query string parameters. In the above example search.cgi will sort search results strictly in title ascending order, no matter what the user pass in s and su query string parameters.

Examples


ReplaceVar etcdir "/usr/local/mnogosearch/etc/"
Include $(etcdir)/include1.conf
Include $(etcdir)/include2.conf
      

See also

ImportEnv, Include, the Section called The SET operator in Chapter 10.