addedValueMacros.searchPrefilled
Syntax
{addedValueMacros.searchPrefilled(formID, initialValues, reportID, sortedBy="", sortDirection="", whatText="", resultsPage="", whatTarget=nil, anchor=nil, class=nil, title=nil, accesskey=nil, hreflang=nil, tabindex=nil, onmouseOver="", onmouseOut="", onClick="") }
- formID - the name of a form defined with usage 'Indexed search'.
- initialValues - a string of ampersand delimited name=value pairs to be used to initialise the form elements.
- reportID - the name of a report that will display the hits.
- sortedBy - optional, the name of a variable to sort the hit list by
- sortDirection - optional, any string other than 'reverse' will sort ascending
- whatText - optional, if empty the results are returned as a string, otherwise returns a link to the page whose shortcut is in the ResultsPage parameter, with link text from whatText.
- ResultsPage - optional, the Manila shortcut of a page to receive the results.
- whatTarget - optional, value of the target attribute for the link.
- anchor - optional, value of the anchor attribute for the link.
- class - optional, value of the class attribute for the link.
- title - optional, value of the title attribute for the link.
- accessKey - optional, value of the accesskey attribute for the link.
- hrefLang - optional, value of the hreflang attribute for the link.
- tabindex - optional, value of the tabindex attribute for the link.
Examples
| {addedValueMacros.searchPrefilled("siteSearch","body=query", "siteSearch", whatText:"See results", "searchResults", whatTarget:"searchPage")} |
See results |
Semantics
searchPrefilled is a variant of addedValueMacros.search, that uses the values in initialValues to simulate entry by the user and perform the search. If whatext = false, it returns the results as a string. Otherwise it returns a link to the results page whose shortcut is in resultsPage, and which must contain another call to addedValueMacros.searchPrefilled with whatText false.
The optional parameters whatTarget, anchor, title, title, accessKey, hrefLang, tabindex are only used if the result is a link and then they are used to build the link.
See also