Search Results page

Available properties

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

Name Type Description
query string 搜索查询
results_count integer The number of results of the search
results array An array ofsearch resultobjects containing all the article and post results from the knowledge base and community
promoted_articles array An array of promotedarticleobjects
ticket_forms array An array ofticket formobjects
help_center object Ahelp_centerobject that holds information and settings about the current help center
settings object Asettingsobject with custom settings for the current theme
help_center_filters array An array offilterobjects. Use these filters to iterate through help centers when searching multiple help centers
source_filters array An array offilterobjects. Use these filters to iterate through help centers and external sources when searching multiple help centers and/or external sources
type_filters array An array offilterobjects. Use these filters to iterate through content types (articles, posts or external types) when searching across multiple content types
filters array An array offilterobjects
subfilters array An array offilterobjects. Use these filters to drill down into the search results categories (for knowledge base results) or topics (for community posts)
content_tag_filters array An array offilterobjects. Use these filters to iterate through content tags when searching by them. Searching by multiple content tags isn't supported
signed_in boolean Whether the user is logged in or not
featured_posts array An array of featuredpostobjects

Available helpers

You can use the following helpers in this page template. You can also use anybuilt-in helpers,global helpers, orglobal advanced helpers.

Name Description
breadcrumbs Breadcrumbs for the search page. Seebreadcrumbs helper
pagination Pagination links. Seepagination helper

Example

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