search

returns the markup for a search box. The search request will be sent to the default /search_results page of your site which gets created on the fly automatically. The search results page requires the search_results.php template to be rendered and that template needs the @t(listPages) tool to process the request. Take a look at the search results template included in the Standard theme to understand the concept.

@t(search{ Options })

Options

placeholder: "Search ..." - string

The placehoder text for the input field.

formClass: "search" - string

The class of the <form> element.

inputClass: "search-input" - string

The class of the <input> element.

button: false - string or false

If defined, an optional <button> is added to the search form. The value of the button option will be then the text of that button.

buttonClass: "search-button" - string

The class of the optional <button> element.


Examples

A simple search box with a custom placeholder text and a button:

@t(search{ 
    placeholder: "Search this site ...",
    button: "Go" 
})

The same search box, but with a side-wide variable as placeholder:

@t(search{ placeholder: @s(placeholder) })