Search Results page

The Search Results page template is rendered when a user navigates to https://{yoursubdomain}.zendesk.com/hc/{locale}/search.

Available properties

You can use the following properties in the search results template.

NameTypeDescription
querystringThe searched query
results_countintegerThe number of results of the search
resultsarrayAn array of search result objects containing all the article and post results from the knowledge base and community
promoted_articlesarrayAn array of promoted article objects
ticket_formsarrayAn array of ticket form objects
help_centerobjectA help_center object that holds information and settings about the current help center
settingsobjectA settings object with custom settings for the current theme
help_center_filtersarrayAn array of filter objects. Use these filters to iterate through help centers when searching multiple help centers
source_filtersarrayAn array of filter objects. Use these filters to iterate through help centers and external sources when searching multiple help centers and/or external sources
type_filtersarrayAn array of filter objects. Use these filters to iterate through content types (articles, posts or external types) when searching across multiple content types
filtersarrayAn array of filter objects
subfiltersarrayAn array of filter objects. Use these filters to drill down into the search results categories (for knowledge base results) or topics (for community posts)
content_tag_filtersarrayAn array of filter objects. Use these filters to iterate through content tags when searching by them. Searching by multiple content tags isn't supported
signed_inbooleanWhether the user is logged in or not
featured_postsarrayAn array of featured post objects
brandobjectA brand object representing the current brand
userobjectA user object representing the current user

Available helpers

You can use the following helpers in this page template. You can also use any built-in helpers, global helpers, or global advanced helpers.

NameDescription
breadcrumbsBreadcrumbs for the search page. See breadcrumbs helper
paginationPagination links. See pagination helper

Example

<nav class="sub-nav sub-nav-far clearfix">  {{breadcrumbs}}  {{search}}</nav>
<div class="search-results clearfix">  <h1>{{results_count}} results found for "{{query}}"</h1>
  {{#each help_center_filters}}    <li>      <a href="{{url}}">{{name}} ({{count}})</a>    </li>  {{/each}}
  {{#each filters}}    <li>      <a href="{{url}}">{{name}} ({{count}})</a>    </li>  {{/each}}
  {{#each subfilters}}    <li>      <a href="{{url}}">{{name}} ({{count}})</a>    </li>  {{/each}}
  {{#each results}}    <div>      <a href="{{url}}">{{title}}</a>      <p class="search-result-description">{{text}}</p>    </div>  {{/each}}
</div>
{{pagination}}