Search Form API

The Search Form API gets the HTML for a search form that can be embedded into a page.

An example usage would be to use this API to put a small search form in the upper right of the header section of a page.

You would not use this API to display the search form on the search page. See Search Layouts & Content Templates for examples of setting up the search page.

This API is different from other APIs in that it doesn't use a content template. Instead, it gets the specified search form and returns the rendered form template HTML. 

You would need to add a search app form first before using this API.

Learn more about APIs.

Minimum Tag

{{ _api.search.form.key('FORM_KEY') }}

Example Tag

Get the search form

{{ _api.search.form.key('FORM_KEY') }}

API Tag Parameters

ParameterDescription
key Required

The form key.

Type: String

Example:
key('search')
template The template to use to process the form if you aren't using the default form template.
The template should be within the "templates/search" folder.
If your template is within the "templates/search/forms" theme folder then you will want to include "forms/" before the template name.

Type: String

Example:
_api.search.form.key('FORM_KEY').template('forms/my-form-template')