Helpers

Helpers are template expressions that perform certain actions. Help Center has the following kinds of helpers:

Note: Some helpers output different HTML based on your theme's Templating API version. These differences are noted in the helper's documentation. To check your theme's version, see About Guide templating versions in Zendesk help.

Built-in helpers

Help Center templates support the following built-in Handlebars block helpers:

  • if
  • unless
  • each
  • with

To learn how to use them, see Handlebars built-in helpers in the Handlebars docs.

Global helpers

In addition to the built-in Handlebars helpers listed above, Help Center provides the following custom helpers, available in all templates:

Shared helpers

There are also some other custom helpers that are page specific and therefore are only available in certain pages:

asset helper

{{asset 'filename'}}

Inserts the relative path of the specified asset.

Parameters

  • filename the filename of the asset

Attributes

  • prefix (optional) adds a prefix to the filename.
  • suffix (optional) adds a suffix to the filename.
  • cdn="legacy" (optional) specifies whether or not to use the legacy CDN for this asset to maintain legacy behavior for older themes. Only available for customers who migrated a theme to the new theming experience. For any new customers who created a Help Center after November 2017, this attribute is not necessary and should not be set.

Availability

  • All pages

Example

<script src="{{asset 'jquery_plugin.js'}}"></script>
<img src="{{asset 'background_image.png'}}" /><img src="{{asset category.id prefix='image-' suffix='.png'}}" />

Output

<script src="/zendesk_cdn_path/jquery_plugin.js"></script>
<img src="/zendesk_cdn_path/background_image.png" /><img src="/zendesk_cdn_path/image-12345.png" />

calc helper

(calc left "operator" right)

Subexpression that returns the result of an arithmetic operation. If the operation is invalid and cannot be safely performed, nil is returned.

You can also use the helper in a normal expression:

{{calc 1 "+" 1}}

The example renders 2.

Parameters

  • left the left operand of the arithmetic operation.
  • operator one of +, -, *, /, %, **.
  • right the right operand of the arithmetic operation.

Attributes

  • float (optional, boolean) the operation is performed with floating-point arithmetics. Default: false.

Availability

  • All pages

Example

You have {{calc settings.badge_count "-" user.badges.length)}} badges left to earn.

Output

Given settings.badge_count is 25 and user.badges.length is 10:

You have 15 badges left to earn.

concat helper

(concat "foo" "bar")

Subexpression that concatenates up to 10 string arguments. Any argument beyond the 10th string is ignored. If any of the arguments are not strings, the helper returns nil.

You can use the helper in a normal expression:

{{concat "foo" "bar"}}

The example renders foobar.

Parameters

  • str1 (optional, string) First string to concatenate
  • str2 (optional, string) Second string to concatenate
  • strN (optional, string) Nth string to concatenate

Attributes

None.

Availability

  • All pages

Example

{{concat "a" "b" "c"}}

Output

abc

contains helper

{{#contains haystack needle}}  ...{{/contains}}

Use the contains helper to check if one string is contained within another, and execute a template block conditionally. The expression evaluates true if the needle can be found within the haystack. Otherwise, it returns false. The check is case-sensitive.

If the expression evaluates to true, the contains block is executed, if given. Otherwise, the else block is executed, if given.

Parameters

  • haystack (required, string)
  • needle (required, string)

Attributes

None.

Availability

  • All pages

Example

{{#contains article.title "Urgent"}}  <strong>{{article.title}}</strong>{{else}}  {{article.title}}{{/contains}}

compare helper

(compare left "operator" right)

Subexpression that returns a boolean value representing the comparison result of 2 operands using a binary operator. If the operation is invalid and therefore cannot be safely performed, the helper returns nil.

You can also use the helper in a regular expression:

{{compare 1 "=" 2}}

The example renders false.

Parameters

  • left the left operand of the comparison.
  • operator one of the following: ==, >, >=, <, <=.
  • right the right operand of the comparison.

Attributes

None.

Availability

  • All pages

Example

{{#if (compare user.badges.length ">" 0)}}  You have earned {{user.badges.length}} badges!{{else}}  You have not earned any badges, yet.{{/if}}

Output

Given the user has earned 2 badges:

You have earned 2 badges!

date helper

{{date timestamp}}

Formats a timestamp into a human-friendly string. The formatted string is localized for the supported languages.

Parameters

  • timestamp an ISO8601 timestamp such as "2015-04-23T13:32:58Z", typically expressed as a Help Center datetime property such as article.created_at

Attributes

  • format (optional, string) displays the date in a specific format. Can be any of the following values: short, medium, long and full
  • timeago (optional, boolean) if true, inserts the date as time elapsed since the present. Example: "2 months ago". Default is false. Only one formatting option (either format or timeago) can be specified at a time. format will take precedence if both are specified
  • class (optional, string) the HTML class to render

format options

You can use any of the following available formats to control the display of date and time stamps. The examples are for the en-us locale, but the formats will differ based on the locale setting.

FormatExampleDescription
short09/14/2015A compact format only showing date
mediumJanuary 2nd 2016A date only format displaying full month name
longMarch 3rd 2015 11:45A long format displaying full month name and time stamp
fullThursday, June 9th 2016 11:45Same as long, but also shows the full name of the day

Availability

  • All pages

Example

{{date article.created_at class='metadata'}}{{date article.created_at class='metadata' timeago=true}}{{date article.created_at class='metadata' format='short'}}

Output

<!-- Text will be localized --><time datetime="2015-01-23T13:32:58Z" class="metadata">January 23, 2015 13:32</time><time datetime="2015-01-23T13:32:58Z" class="metadata">2 months ago</time><time datetime="2015-01-23T13:32:58Z" class="metadata">01/23/2015</time>

dc (dynamic content) helper

{{dc 'identifier'}}

Use the dc helper to show dynamic content translated according to the current locale.

Parameters

  • identifier indicates the dynamic content to be inserted and translated

If identifier doesn't exist, a default message is shown.

See this article to learn how to add new dynamic content.

Attributes

None.

Availability

  • All pages

Example

{{dc 'example'}}
{{dc 'foo'}}

Output

Supposing that example is defined as dynamic content and foo is not:

<!-- 'example' was found, localized content is shown -->This is an example.
<!-- 'foo' not found, default message is shown -->Could not find the placeholder for dynamic content named foo

excerpt helper

{{excerpt string}}

Inserts the first few lines of a content item such as an article or post. If the argument contains any HTML tags, they will be stripped out before the text truncation takes place.

Parameters

  • string a content item, usually expressed as a Help Center content property such as article.body

Attributes

  • characters (optional, integer) the number of characters to display from the start of the item. Default is 120

Availability

  • All pages

Example

{{excerpt article.body characters=100}}

Output

<!-- First 100 characters of the article body followed by "..." -->Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqu...

filter helper

(filter collection on="property_name" attribute="string")

Subexpression that returns a collection on the specified property, containing those items where all of the specified conditions match. Returns an empty collection in case of an error. Omitting on or specifying an unknown property name will cause an error. Specifying an attribute not listed in Attributes below will cause an error.

Parameters

  • collection an array of Curlybars objects such as user.badges
  • attribute a condition such as starts_with or contains. See Attributes below for the full list

Attributes

  • on (required, string) a string representing the property of the objects in the collection. The value of that property is the subject to the filtering rules. You can use dot notation to access nested properties. Example: author.name. All the remaining attributes are interpreted as filters to be applied to the specified property.
  • starts_with (optional, string) a string value representing the asserted prefix of the subject.
  • ends_with (optional, string) a string value representing the asserted suffix of the subject.
  • contains (optional, string) a string value representing the asserted infix of the subject.
  • equals (optional, any) a value representing the asserted identity of the subject.

Availability

  • All pages

Example

{{#each (filter user.badges on="category_slug" starts_with="abc" ends_with="cba")}}  Matching badge: {{category_slug}}{{/each}}

Output

Matching badge: abc1cbaMatching badge: abc2cbaMatching badge: abc3cba

is helper

{{#is 'left' 'right'}}  ...{{/is}}

Use the is helper to execute a template block conditionally, given an expression result. If the comparison evaluates to true (the two values are equal), then the is block will be executed, if given. Otherwise, if the comparison evaluates to false, the else block will be executed, if given. The comparison is always based on the === JS operator.

Parameters

  • left value that will be used in the comparison. This is required and can be a path, a string, a number a boolean or a variable
  • right value that will be used in the comparison. This is required and can be a path, a string, a number a boolean or a variable

Attributes

None.

Availability

  • All pages

Example

{{#is article.author.name 'John'}}  The author of the article is John.{{else}}  The author of the article is not John.{{/is}}

isnt helper

{{#isnt 'left' 'right'}}  ...{{/isnt}}

Use the isnt helper to execute a template block conditionally, given an expression result. If the comparison evaluates to true (the two values are not equal), then the isnt block will be executed, if given. Otherwise, if the comparison evaluates to false, the else block will be executed, if given. The comparison is always based on the !== JS operator.

Parameters

  • left value that will be used in the comparison. This is required and can be a path, a string, a number a boolean or a variable
  • right value that will be used in the comparison. This is required and can be a path, a string, a number a boolean or a variable

Attributes

None.

Availability

  • All pages

Example

{{#isnt article.author.name 'John'}}  The author of the article is not John.{{else}}  The author of the article is John.{{/isnt}}

json_stringify helper

Converts a normal string into a JSON string that you can use in your JavaScript.

{{json_stringify 'string'}}

Parameters

  • string a normal string with unescaped newlines, quotes, or unicode characters

Attributes

None.

Availability

  • All pages

Example

<script>  var title = {{json_stringify article.title}};</script>

Output

<script>  var title = "Setting the \"enduser\" value";</script>

{{link 'identifier'}}

Use the link helper to link to other pages in Help Center. This helper is available in all page templates.

This will render both the HTML tag and link text. A default string in the proper locale is used for the link text. For example, the new_request identifier will render the default "Submit a Request" string as a link. You can also customize the string by using the block version of the link helper. Example:

{{#link 'identifier'}}  Custom link text{{/link}}

If you only need a URL, see the page_path helper.

The link helper also takes care of hiding the link from certain users. For example, in a restricted Help Center you may want to hide the "Submit a Request" link from unregistered users. You can display alternative text when the link is hidden. Example:

{{#link 'identifier'}}  Link text{{else}}  This link is not available for you{{/link}}

Note that the alternative text won't be wrapped in a link tag.

Parameters

  • identifier indicates the destination page to link to

You can link to the following destination pages:

IdentifierDestination page
help_centerHelp Center Home page
new_requestNew Request page
my_activitiesMy Activity page
requestsRequest List page
contributionsContributions page
subscriptionsFollowing page
communityCommunity main page
topicsTopics page
sign_inSign-in page
sign_outSign-out page
user_profileUser profile page for a specific user
postsPosts page
search_resultSearch results page

Attributes

Varies from identifier to identifier. See below.

Availability

  • All pages

Example

{{link 'new_request' class='submit-a-request' role='button'}}
{{#link "my_activities" class="my-activities" role="button"}}  {{t "my_activites"}}{{else}}  <span>Activities are not available for you</span>{{/link}}

Output

<a href="/new_request" class="submit-a-request" role="button">  Submit a Request</a>
<!-- If user is not allowed to see My Activities page --><span>Activities are not available for you</span>

{{link 'help_center'}}

Displays a link to the Help Center home page.

Attributes
  • class (optional, string) an HTML class
  • role (optional, string) an HTML role
  • selected (optional, string) the HTML aria-selected attribute. Can be "true" or "false"
  • target (optional, string) the HTML target attribute
Availability
  • All templates
Example
{{link 'help_center' class='help-center-link'}}

{{link 'new_request'}}

Displays a link to the page for submitting a new request.

If you use ticket forms (available in the Enterprise plan), you can link to a specific ticket form with the ticket_form_id attribute. You can get the id from the administrator interface in Zendesk Support or from the Ticket forms API.

Attributes
  • class (optional, string) an HTML class
  • role (optional, string) an HTML role
  • selected (optional, string) the HTML aria-selected attribute. Can be "true" or "false"
  • target (optional, string) the HTML target attribute
  • ticket_form_id (optional, string) the id of the ticket form to display. Requires a ticket form that's visible to end users. Available only on the Enterprise plan.
Availability
  • All templates
Examples
{{link 'new_request' class='submit-a-request' role='button'}}
<!-- referencing a specific ticket form -->{{link 'new_request' ticket_form_id='1234'}}

{{link 'my_activities'}}

Displays a link to the page with the end user's activities. If signed in as an agent or Help Center manager, the link is not displayed.

Attributes
  • class (optional, string) an HTML class
  • role (optional, string) an HTML role
  • selected (optional, string) the HTML aria-selected attribute. Can be "true" or "false"
  • target (optional, string) the HTML target attribute
Availability
  • All templates
Example
{{link 'my_activities' class='my-activities' role='button'}}

{{link 'requests'}}

Displays a link to the page listing the end user's requests. The link is not displayed if the user is anonymous.

Attributes
  • class (optional, string) an HTML class
  • role (optional, string) an HTML role
  • selected (optional, string) the HTML aria-selected attribute. Can be "true" or "false"
  • sort_by (optional, string) the request attribute to sort by. Valid values: created_at and updated_at.
  • target (optional, string) the HTML target attribute
Availability
  • All templates
Example
{{link 'requests' class='requests-link'}}

Displays a link to the page showing a single request.

Attributes
  • id (required, integer) the id of a request
  • class (optional, string) an HTML class
  • target (optional, string) the HTML target attribute
Availability
  • All templates
Example
{{link 'request' id=request.id, class='followup-link'}}

{{link 'contributions'}}

Displays a link to the page listing the end user's community contributions. The link is not displayed if the user is anonymous.

Attributes
  • class (optional, string) an HTML class
  • role (optional, string) an HTML role
  • selected (optional, string) the HTML aria-selected attribute. Can be "true" or "false"
  • target (optional, string) the HTML target attribute
Availability
  • All templates
Example
{{link 'contributions' class='contributions-link'}}

{{link 'subscriptions'}}

Displays a link to the page listing the content items that the end user is following. The link is not displayed if the user is anonymous.

Attributes
  • class (optional, string) an HTML class
  • role (optional, string) an HTML role
  • selected (optional, string) the HTML aria-selected attribute. Can be "true" or "false"
  • target (optional, string) the HTML target attribute
Availability
  • All templates
Example
{{link 'subscriptions' class='subscriptions-link'}}

{{link 'community'}}

Displays a link to the community main page. The link is not displayed if the community is disabled.

Attributes
  • class (optional, string) an HTML class
  • role (optional, string) an HTML role
  • selected (optional, string) the HTML aria-selected attribute. Can be "true" or "false"
  • target (optional, string) the HTML target attribute
Availability
  • All templates
Example
{{link 'community' class='community-entrance' role='button'}}

{{link 'topics'}}

Displays a link to the page that lists all community topics. The link is not displayed if the community is disabled.

Attributes
  • class (optional, string) an HTML class
  • role (optional, string) an HTML role
  • selected (optional, string) the HTML aria-selected attribute. Can be "true" or "false"
  • target (optional, string) the HTML target attribute
Availability
  • All templates
Example
{{link 'topics' class='community-topics-link' role='button'}}

{{link 'sign_in'}}

If your Help Center requires users to sign in and the user is not signed-in, displays a link to the page for signing-in.

Attributes
  • class (optional, string) an HTML class
  • role (optional, string) an HTML role
  • selected (optional, string) the HTML aria-selected attribute. Can be "true" or "false"
  • target (optional, string) the HTML target attribute
Availability
  • All templates
Example
{{link 'sign_in' class='submit-a-request'}}

{{link 'sign_out'}}

Render a link to the home page for signing-out. The link will be hidden in preview mode.

Attributes
  • class (optional, string) an HTML class
  • role (optional, string) an HTML role
  • selected (optional, string) the HTML aria-selected attribute. Can be "true" or "false"
  • target (optional, string) the HTML target attribute
Availability
  • All templates
Example
{{link 'sign_out' class='sign-out'}}

{{link 'user_profile' id=user.id}}

Displays a link to the user's profile page

  • If user profiles are enabled, links to the user's profile
  • If user profiles are disabled, links to the agent interface if the current user is an agent. Otherwise displays the body without linking
Attributes
  • id (required, id) the user's id
  • class (optional, string) an HTML class
  • role (optional, string) an HTML role
  • selected (optional, string) the HTML aria-selected attribute. Can be "true" or "false"
  • target (optional, string) the HTML target attribute
Availability
  • All templates
Example

On the User Profile page:

{{link 'user_profile' id=user.id class='user-profile-link'}}

On the Article Page:

{{#each comments}}  {{link 'user_profile' id=author.id class='user-profile-link'}}{{/each comments}}

{{link 'posts'}}

Displays a link to the posts page.

Attributes
  • class (optional, string) an HTML class
  • role (optional, string) an HTML role
  • selected (optional, string) the HTML aria-selected attribute. Can be "true" or "false"
  • target (optional, string) the HTML target attribute
Availability
  • All templates
Example
{{link 'posts' class='posts-link'}}

{{link 'search_result'}}

Displays a link to the search results page. If the content_tag_id attribute is used, it links to the search page rendering the results that are tagged with the given content tag.

Attributes
  • class (optional, string) an HTML class
  • role (optional, string) an HTML role
  • selected (optional, string) the HTML aria-selected attribute. Can be "true" or "false"
  • target (optional, string) the HTML target attribute
  • content_tag_id (optional, string) the id of the content tag
Availability
  • All templates
Example
{{link 'search_result' class='search-link'}}

not helper

(not value)

Subexpression that returns the negated value of the argument.

Parameters

  • value the value to be negated.

Attributes

None.

Availability

  • All pages

Example

{{if (not settings.supress_warnings)}}  You have been warned.{{/if}}

Output

Given settings.supress_warnings is set to false:

You have been warned.

page_path helper

{{page_path 'identifier'}}

If you don't need the HTML and link text rendered by the link helper, you can use the page_path helper. It's available in all Help Center pages.

Parameters

  • identifier indicates the destination page to link to

The identifiers are the same as the link helper.

Attributes

The attributes are also the same, except for the CSS-related ones like class, role and selected, which aren't supported.

Availability
  • All pages

Example

{{page_path 'new_request' ticket_form_id='1234'}}

Output

/path_to_request_form

search helper

{{search}}

Inserts a search box.

Parameters

None.

Attributes

  • scoped (optional, boolean) If scoped is true and the helper is on the category, section, or article page, searches only the articles in the current category. If the helper is on the topic or post page, searches only the posts in the current topic. Default is false.
  • submit (optional, boolean) If true, render the submit button. Default is false.
  • instant (optional, boolean) If true, enables Instant Search to provide HC article suggestions while you type in the search box. Instant Search article suggestions do not respect the scoped parameter if it is set.
  • class (optional, string) class name to be added to the form
  • placeholder (optional, string) placeholder value for the search input element

Availability

  • All pages

Example

{{search}}

Output

If inserted in the Home page:

<form accept-charset="UTF-8" action="/hc/en-us/search" class="search" method="get" role="search">  <input name="utf8" type="hidden" value="&#x2713;" />  <input id="query" name="query" placeholder="Search" type="search" />  <input name="commit" type="submit" value="Search" /></form>

slice helper

(slice collection start length)

Subexpression that returns a sub-array starting at the start index and continuing for length elements. Negative indices count backward from the end of the array. Returns an empty array if the starting index is out of range.

Parameters

  • collection an array of Curlybars objects such as user.badges.
  • start a number representing the start index of the array.
  • length a number representing the number of elements to follow after the start index.

Attributes

None.

Availability

  • All pages

Example

Positive start index:{{#each (slice user.badges 0 3)}}  - Matching badge: {{name}}{{/each}}
Negative start index:{{#each (slice user.badges -3 3)}}  - Matching badge: {{name}}{{/each}}

Output

Given an array of badges with the names: 1, 2, 3, 4, 5:

Positive start index:- Matching badge: 1- Matching badge: 2- Matching badge: 3
Negative start index:- Matching badge: 3- Matching badge: 4- Matching badge: 5

user_avatar helper

{{user_avatar class='user_avatar'}}

Use the user_avatar helper to insert the current user avatar image. An image is always shown, anonymous users see a default fallback avatar image. For performance reasons Help Center uses a special internal data attribute in the generated HTML image element to load the actual image file using JavaScript.

Parameters

None.

Attributes

  • class (optional, string) a space separated list of class names that will be added to the generated <img> tag

Availability

  • All pages

Example

{{user_avatar class='rounded-avatar'}}

Output

<img alt="Avatar" class="rounded-avatar" src="https://secure.gravatar.com/avatar/123456" />

user_name helper

{{user_name}}

Use the user_name helper to insert the current user name or alias. For performance reasons Help Center uses a special internal data attribute in an empty HTML span element to load the name using JavaScript.

Parameters

None.

Attributes

None

Availability

  • All pages

Example

{{user_name}}

Output

<span data-user-name="[user name or alias]">[user name or alias]</span>

t (translation) helper

{{t 'key'}}

Use the t helper to show translated texts for each locale available in your Help Center.

Parameters

Attributes

Some keys accept one or more of the following optional attributes.

AttributeType
countinteger
content_tagstring
due_datestring
editor_namestring
namestring
querystring
request_namestring
request_numberinteger
scope_namestring
totalinteger
upvotesinteger

Availability

  • All pages

Example

{{t 'back_to_homepage'}}{{t 'post_count' count=1}}{{t 'show_all_articles' count=section.article_count}}{{t 'found_helpful' upvotes=article.upvote_count total=article.vote_count}}

Output

<!-- Text will be localized -->Take me back to the home page7 postsSee all 13 articles4 out of 5 found this helpful

Available keys

You can use any of the following available keys to display translated strings.

KeysEnglish translationNotes
activity_overviewActivity overview
add_commentAdd comment
add_to_conversationAdd to conversation
allAll
all_postsAll community posts
article_location_with_titleLocation of the article titled "%{title}"Accepts a 'title' attribute.
articlesArticles
articles_in_sectionArticles in this section
assigneeAssigned to
attachments_headingAttachments
back_to_homepageTake me back to the home page
badgesBadges
badges_awardedAwarded
badges_descriptionRecently awarded badges to %{name}Accepts a 'name' attribute.
browsebrowse
browse_communityCommunity
browse_help_centerBrowse Help Center
browse_knowledge_baseBrowse Knowledge Base
categoriesCategories
ccd_requestsRequests I'm CC'd on
ccsCCs
ccs_descriptionThe following people will also be notified when this request is updated:
commentcomment/commentsThe word 'comment' in singular or plural form. Accepts a 'count' attribute.
comment_editedEdited by %{editor_name}Accepts an 'editor_name' attribute.
comment_location_with_author_nameLocation of the comment by %{author_name}Accepts an 'author_name' attribute.
commentsComments
comments_count%{count} comment/commentsAccepts a 'count' attribute.
communityCommunity
community_topicsCommunity Topics
content_tags_descriptionAdd content tags to help people find related content
content_tags_labelRelated to
contributionsContributions
downloadDownload
editedEdited
emptyempty
external_content_location_with_titleLocation of the external content titled "%{title}"Accepts a 'title' attribute.
featuredFeatured
featured_postsFeatured posts
filter_by_categoryBy Category
filter_by_help_centerBy Help Center
filter_by_topicBy Topic
filter_by_typeBy Type
filter_content_tagRelated to
filter_sourceSource
filter_typeType
followed_byFollowed by
follower_count%{count} followersAccepts a 'count' attribute.
followingFollowing
following_usersFollowingSignifies that the subject of the subscription is a user instead of content.
followupFollow-up
found_helpful%{upvotes} out of %{total} found this helpfulShow number of up votes out of the total. Accepts 'upvotes' and 'total' attributes.
go_to_commentsGo to comments section
go_to_help_centerYou can also go to the help center home page
groupGroup
homeHome
home_page%{name} Help Center home pageAccepts a 'name' attribute.
internalOnly visible to agents and managers
join_conversationJoin the conversation
knowledge_baseKnowledge Base
mark_as_solvedMark as solved
mark_as_solved_and_submitMark as solved & Submit
member_sinceMember since
logoLogo
latest_activityLatest activity by %{name}Accepts a 'name' attribute.
mistyped_address_or_moved_pageYou have mistyped the address or the page may have moved.
more_awards_to1 more awarded badge for %{name}/%{count} more awarded badges for %{name}Accepts 'count' and 'name' attributes.
my_activitiesMy activities
my_profileMy profile
my_requestsMy requests
my_subscriptionsMy subscriptions
new_postNew post
no_activity_yetNo activity yet
no_articlesNothing here yet. Articles will appear here.
no_badgesYou currently have no badges.
no_commentsNothing here yet. Comments will appear here.
no_contentNothing to see here yet.
no_content_yetNo content yet. Engage in the conversation to activate your profile.
no_contributionsYou currently have no contributions.
no_featured_postsNo featured posts yet.
no_postsNothing here yet. Posts will appear here.
no_posts_with_filterNo posts for the selected filter
no_requestsNo requests found
no_resultsNo results for "%{query}"Accepts a 'query' attribute.
no_results_unifiedTry searching another keyword.
no_results_unified_enter_keywordsEnter your keywords in the search field.
no_results_unified_start_new_searchStart a new search
no_subscriptionsYou currently have no subscriptions
nonexistent_pageThe page you were looking for doesn't exist
not_authorizedYou're not authorized to access this page.
not_followingYou are not following anything yet.
official_commentOfficial comment
oopsoops.
open_user_in_supportOpen user in Zendesk Support
optionaloptional
organizationOrganization
organization_requestsOrganization requests
pagination_nextNext
pagination_previousPrevious
pagination_firstFirst
pagination_lastLast
pending_approvalPending approval
pinnedPinned
plus_more+%{count} moreAccepts a 'count' attribute.
postPost
post_count%{count} post/postsAccepts a 'count' attribute.
post_location_with_titleLocation of the post titled "%{title}"Accepts a 'title' attribute.
postsPosts
preview_result_headerNo results for "%{query}/Result for "%{query}/Results for "%{query}Accepts a 'query' attribute.
priorityPriority
privatePrivate
private_activityThis user's activity is private.
profileProfile
promotedPromoted
promoted_articlesPromoted articles
related_articlesRelated articles
requestRequest #%{request_number}Accepts a 'request_number' attribute
requestsRequests
requests_search_results_infoNo results/1 result/%{count} results for "%{query}Accepts 'count' and 'query' attributes.
resultsNo results/One result/%{count} results for "%{query}"Accepts 'count' and 'query' attributes.
results_content_tagNo results/One result/%{count} results related to "%{content_tag}"Accepts 'count' and 'content_tag' attributes.
results_with_scopeNo results/One result/%{count} results for "%{query}" in %{scope_name}Accepts 'count', 'query' and 'scope_name' attributes.
return_to_topReturn to top
sign_inSign in
searchSearch
search_clearClear search
search_result_source_menuSearch Result Source Menu
search_result_subfilter_menuSearch Result Subfilters Menu
search_result_type_menuSearch results
search_resultsSearch results
see_all_sectionsSee all sections...
see_moreSee more
see_more_communitySee 1 Community result/See all %{count} Community resultsAccepts a 'count' attribute.
see_more_knowledge_baseSee 1 knowledge base result/See all %{count} knowledge base resultsAccepts a 'count' attribute.
shareShare
show_all_articlesSee all %{count} articlesAccepts a 'count' attribute.
show_all_postsShow all posts
show_more_categoriesShow more categories
show_more_help_centersShow more Help Centers
show_more_sourcesShow more sources
show_more_topicsShow more topics
show_topicsShow topics
skip_navigationSkip to main content
sort_bySort by
submitSubmit
submit_a_requestSubmit a request
submitted_by%{requester_name} submitted this requestAccepts a 'requester_name' attribute.
subscriptionsSubscriptions
suggest_new_postDidn't find what you were looking for?
task_due_date(Due on %{due_date})Accepts a 'due_date' attribute.
team_memberUser (%{name}) is a team memberAccepts a 'name' attribute.
ticket_detailsTicket details
toggle_navigationToggle navigation menu
topicsTopics
total_activityTotal activity
updatedUpdated
users_count0 users/1 user/%{count} usersAccepts a 'count' attribute.
view_commentView comment
votevote/votesThe word 'vote' in singular or plural form. Accepts a 'count' attribute.
votesVotes
votes_count0 votes/1 vote/%{count} votesAccepts a 'count' attribute.
votes_sum0 votes/1 vote/%{count} votesAccepts a 'count' attribute.
was_this_article_helpfulWas this article helpful?
what_is_your_post_aboutWhat is your post about?

Available keys for table headers:

KeysEnglish translation
createdCreated
requesterRequester
idId
last_activityLast Activity
statusStatus
subjectSubject
subscriptionFollowing
titleTitle
typeType
vote_sumVote Sum

Available keys for form field labels:

KeysEnglish translation
details_labelDetails
title_labelTitle
topic_labelTopic

{{breadcrumbs}}

Inserts a breadcrumbs navigation element to identify the location of the current page.

Parameters

None.

Attributes

None.

Availability

  • Article page
  • Category page
  • Contributions page
  • Request page
  • Request List page
  • Search Results page
  • Section page
  • Following page
  • New Community Post page
  • New Request page
  • Community Post page
  • Community Topic List page
  • Community Topic page
  • Community Post List page

Example

{{breadcrumbs}}

Output

The markup the helper generates depends on several factors, including:

  • The theme's Templating API version
  • The page it's used on
  • The particular articles, sections, and categories in your help center
  • The name of your help center

For example, on the Article page, the following is the helper's output for an article within the subsection "Announcements subsection", the section "Announcements", and the category "General":

form helper

Some pages in Help Center include one or more forms. Form helpers simplify building forms and form elements.

{{#form form_name}}...{{/form}}

This will safely insert an HTML form in the templates. See the page-specific documentation to find out which forms you can use in each template.

You must use the form helpers like label, input, and checkbox to render the form fields. See more below.

Parameters

  • form_name one of the following: comment, organization, post, request, or requests

Attributes

  • class (optional, string) the HTML class to render
  • id (optional, string) the HTML id attribute to render

Availability

FormAvailable in
commentArticle page
commentPost page
commentRequest page
organizationRequest page
requests_filterRequest List page
postNew Post page

Example

{{#form 'comment' class='comment-form'}}   ...{{/form}}

Output

If inserted in an Article page:

<form class="comment-form" accept-charset="UTF-8" action="/hc/articles/123456/comments" method="post">  <input name="utf8" type="hidden" value="">  ...</form>

Form field helpers

Help Center provides the following form field helpers that must be used inside the form helper:

You can also use these advanced form field helpers:

Identifiers

Identifiers distinguish similar fields inside the same form. The following identifiers are available:

IdentifierAvailable inFormField(s)Description
bodyArticle page, Post page and Request pagecommenttextarea, wysiwygIdentifies a text field for content (use wysiwyg for rich content)
officialPost pagecommentlabel, checkboxIdentifies a checkbox field to mark a comment as official
titleNew Post pagepostlabel, inputIdentifies a text field for the post title
detailsNew Post pagepostlabel, wysiwygIdentifies a text field for content (use wysiwyg for rich content)
topicNew Post pagepostlabel, selectIdentifies a drop-down to select a topic
content_tagsNew Post pagepostlabel, multiselectIdentifies a drop-down to create or select multiple content tags
mark_as_solvedRequest pagecommentlabel, checkboxIdentifies a checkbox to mark a request as solved
ccsRequest pagecommenttoken_fieldIdentifies an email (CC) field
organizationRequest pageorganizationselectIdentifies a drop-down to select an organization
organizationRequest List pagerequests_filterlabel, selectIdentifies a drop-down to select an organization
queryRequest List pagerequests_filterinputIdentifies a search field
statusRequest List pagerequests_filterlabel, selectIdentifies a drop-down to select a status
input

{{input 'identifier'}}

Creates a textbox based on the given identifier.

Parameters
  • identifier the name of the field (optional). Depends on the page and the form that has the field. See identifiers. In some cases, such as when you want to create a submit button, you don't need an identifier.
Attributes
  • type (optional, string) the type of the input, valid values are: text, submit, email, number. Default is text
  • class (optional, string) the HTML class to assign to the form
  • id (optional, string) the html id (only available if no identifier is given, otherwise the identifier will set this value)
  • name (optional, string) the HTML name. Only available if no identifier is given. Otherwise the identifier will set this value
  • value (optional, string) the value of the input
  • label (optional, string) the HTML placeholder. Only available if no identifier is given. Otherwise the identifier will set this value
  • autofocus (optional, boolean) whether the input field is auto-focused or not. False by default
  • required (optional, boolean) whether the input field is mandatory or not
Examples
{{input type='submit' name='submit' id='submit-button'}}
{{input 'first_name' type='text' class='small'}}
{{input type='text' class='small' id='first_name' name='user[first_name]' label='Please insert your name'}}
textarea

{{textarea 'identifier'}}

Creates a textarea based on the given identifier.

Parameters
  • identifier the name of the field (required). Depends on the page and the form that has the field. See identifiers.
Attributes
  • class (optional, string) the HTML class to assign to the form
  • rows (optional, string) specifies the visible height of a text area, in lines
  • cols (optional, string) specifies the visible width of a text area
Example
{{textarea 'body' rows='4' class='awesome'}}
checkbox

{{checkbox 'identifier'}}

Creates a checkbox based on the given identifier.

Parameters
  • identifier the name of the field (required). Depends on the page and the form that has the field. See identifiers.
Attributes
  • class (optional, string) the HTML class to assign to the form
Example
{{checkbox 'mark_as_solved' class='red'}}
label

{{label 'identifier'}}

Creates a label based on the given identifier.

Parameters
  • identifier the name of the field (required). Depends on the page and the form that has the field. See identifiers.
Attributes
  • class (optional, string) the HTML class to assign to the form
  • for (optional, string) the form element the label is bound to
Example
{{label 'mark_as_solved' for='request-status-select' class='red'}}
select

{{select 'identifier'}}

Creates a select input based on the given identifier.

The markup this helper generates depends on several factors, including:

  • The identifier
  • The theme's Templating API version
Parameters
  • identifier the name of the field (required). Depends on the page and the form that has the field. See identifiers.
Attributes
  • class (optional, string) the HTML class to assign to the form
Example
{{select 'mark_as_solved' class='red'}}
multiselect

{{multiselect 'identifier'}}

Creates a multiselect input based on the given identifier.

Parameters
  • identifier the name of the field (required). Depends on the page and the form that has the field. See identifiers.
Example
{{multiselect 'content_tags'}}
required
{{#required 'identifier'}}  block{{/required}}

Executes the block if the 'identifier' field is required.

Parameters
  • identifier the name of the field (required). Depends on the page and the form that has the field. See identifiers.
Example
{{#required 'mark_as_solved'}}  This is required.{{else}}  This is not required.{{/required}}
validate
{{#validate 'identifier'}}  block{{/validate}}

Executes the block if the 'identifier' field has errors.

Parameters
  • identifier the name of the field (required). Depends on the page and the form that has the field. See identifiers.
Example
{{#validate 'mark_as_solved'}}  The data introduced has errors.{{else}}  The data introduced is right.{{/validate}}
error

{{error 'identifier'}}

Renders the error message associated with the given identifier, if any.

Parameters
  • identifier the name of the field (required). Depends on the page and the form that has the field. See identifiers.
Example
{{error 'mark_as_solved'}}

pagination helper

{{pagination}}

Renders pagination elements that let a user browse more than one page.

This will only render if the number of elements is greater than the size of a page.

Parameters

  • identifier indicates the array to paginate. Only available in the section page.

The following identifiers are available:

IdentifierAvailable inDescription
section.articlesSection pageShows pagination controls for articles of a section. Default value.
section.sectionsSection pageShows pagination controls for sections of a section.

Attributes

None.

Availability

  • Home page
  • Article page
  • Contributions page
  • Request List page
  • Search Results page
  • Section page

Example

{{pagination}}

Output

On the second page if inserted in a Section page:

<nav class="pagination">  <ul>    <li class="pagination-first">      <a href="/hc/en-us/sections/123-MySection">«</a>    </li>    <li class="pagination-prev">      <a href="/hc/en-us/sections/123-MySection" rel="prev"></a>    </li>    <li>      <a href="/hc/en-us/sections/123-MySection" rel="prev">1</a>    </li>    <li class="pagination-current">      <span>2</span>    </li>    <li>      <a href="/hc/en-us/sections/123-MySection?page=3" rel="next">3</a>    </li>    <li class="pagination-next">      <a href="/hc/en-us/sections/123-MySection?page=3" rel="next"></a>    </li>    <li class="pagination-last">      <a href="/hc/en-us/sections/123-MySection?page=3">»</a>    </li>  </ul></nav>

share helper

{{share}}

Adds elements for sharing content on social media.

Parameters

None.

Attributes

None.

Availability

  • Article page

Example

{{share}}

Output

If inserted in an Article page:

<ul class="share">  <li><a href="[sharing url to Facebook]" class="share-facebook">Facebook</a></li>  <li><a href="[sharing url to Twitter]" class="share-twitter">Twitter</a></li>  <li><a href="[sharing url to LinkedIn]" class="share-linkedin">LinkedIn</a></li>  <li><a href="[sharing url to Google]" class="share-googleplus">Google+</a></li></ul>

Note that the sharing urls might change in the future if the social media service changes their sharing API.

subscribe helper

{{subscribe}}

Inserts a "Follow" button that gives visitors the option of receiving update notifications by email. A section follower is notified when somebody adds an article or comment. A topic follower is notified when somebody adds a post or a comment. An article or post follower is notified when somebody adds a comment. An organization follower is notified when somebody in the same organization creates a new request. A user follower is notified when the user adds an article, post, or comment.

Parameters

None.

Availability

  • Section page
  • Article page
  • Topic page
  • Post page
  • Request List page
  • User Profile page

Example

{{subscribe}}

Output

In article page, if user is not subscribed:

<button data-selected="false" aria-expanded="true" aria-haspopup="menu" type="button" id="[element id]">Follow</button>

In article page, if user is subscribed:

<button data-selected="true" aria-expanded="true" aria-haspopup="menu" type="button" id="[element id]">Unfollow</button>

vote helper

{{vote 'element' class='element-class' selected_class='element-selected-class'}}

Use the vote helper to insert vote-related elements. These elements must apply to a specific votable resource (i.e. an article). When the user is authenticated and therefore able to vote, all vote elements are synced (i.e. if user votes up in an article, its labels and counters update their values without refreshing the page). When the user is not authenticated, the 'up' and 'down' buttons act like normal links, redirecting user to the sign in page.

Parameters

  • element one of the following: up, down, label, sum, or count
ElementDescription
uprenders a vote up button
downrenders a vote down button
labelrenders the "X out of Y found this helpful" label
sumrenders the sum of all votes
countrenders the total number of votes

Attributes

  • class (optional, string) the class of the element
  • selected_class (optional, string) the class to be added to the element when it is selected (applies to 'up' and 'down' elements only)
  • role (optional, string) the HTML role to render. Only available in Templating API v1.

Availability

Example

Supported variables vary based on your Templating API version.

Output

The rendered output varies based on your Templating API version.

change_password helper

{{change_password}}

Inserts a button that lets end users launch the Change Password modal. The button will only appear for end users and if changing passwords is available.

Attributes

  • class (optional, string) the class of the element
  • role (optional, string) the HTML role to render

Example

{{change_password}}

Output

<button data-action="change-password" title="Opens a dialog">Change password</button>

Availability

  • Header
  • Footer
  • User Profile page

my_profile helper

{{my_profile}}

If user profiles are enabled, the helper renders a link to the user's user profile page.

If user profiles are disabled, but endusers can edit profile data, a button to launch a Edit Profile modal is rendered.

You can also customize the string by using the block version of the my_profile helper.

Attributes

  • class (optional, string) an HTML class
  • role (optional, string) an HTML role

Example

{{my_profile}}
{{#my_profile}}  Custom My Profile text{{/my_profile}}

Output

if user profiles are enabled:

<a href="[path to user profile]">My profile</a>
<a href="[path to user profile]">Custom My Profile text</a>

if user profiles are disabled, but users can edit profile data:

<button data-action="edit-profile">Edit my profile</button>
<button data-action="edit-profile">Custom My Profile text</button>

Availability

  • Header
  • Footer