Skip to content

config searchalttemplate

Byrne edited this page Nov 1, 2010 · 1 revision

SearchAltTemplate

This configuration directive specifies alternative search templates which can be specified in a search form in the published site. SearchAltTemplates may be required if publishing multiple weblogs or if alternate versions of your search results are desired.

You can specify more than one SearchAltTemplate in the configuration. However, that specifying SearchAltTemplate in the configuration overwrites the default value. To add search templates, you must specify the default value in the configuration as well.

Additional search templates should be added on the file system to $MT_HOME/search_templates

Default: feed results_feed.tmpl

Example

SearchAltTemplate feed results_feed.tmpl

(This the default behavior)

Usage

This example sets up the alternate template for the "work" and "comment" search in addition to the default feed search.

SearchAltTemplate feed results_feed.tmpl
SearchAltTemplate work work.tmpl
SearchAltTemplate comment comments.tmpl

To use the "work" template, place this line:

<input type="hidden" name="Template" value="work">

...in the search form like this search (simplified example form):

<form method="get" action="<$mt:CGIPath$><$mt:SearchScript$>">
    <input type="hidden" name="Template" value="work">
    <input type="text" name="search" value="<$mt:SearchString$>" />
    <input type="submit" value="Search" />
</form>

This directive was introduced in version 4.2. This directive deprecates AltTemplate directive. The purpose and the behavior of the two directives are exactly the same.

  • Categories: Appendix: Configuration Directives
  • Tags: config, New in MT4.2, search
Clone this wiki locally