Advanced helpers

The following helpers provide advanced functionality. We don't recommend heavily customizing the output of any of these helpers with JavaScript or CSS because their internal implementation might change in the future.

Global advanced helpers

The following advanced helpers are available in all templates:

Shared advanced helpers

The following advanced helpers are only available in certain pages:

recent_activity helper

{{recent_activity}}

A list of 5 recent activities for Help Center. Recent activities consist of the following:

  • Newly created articles
  • New translations of existing articles
  • New comments on articles

If the affected article is not visible to the user, the activity won't be displayed in the list.

If you set scope='community' (see below), the following activities are displayed:

  • New community posts
  • New community comments

There's no time limit for recent activity. If the most recent activity was a year ago, it will still appear at the top of the list.

Availability

  • All pages

Parameters

  • scope (optional, string) Can be community, category, or section. If set to community, displays the 5 most recently created community posts or post comments visible to the user. If set to category or section, displays only recent activity for a category or section. The category and section scopes only work in the Category and Section page templates respectively.

Example

{{recent_activity scope='section'}}

recent_articles helper

{{recent_articles}}

A list of articles recently viewed by the user in the browser.

Availability

  • All pages

actions helper

{{actions}}

A user menu including all the available actions for the current object.

Availability

Example

{{#each comments}}  ...  <span class="comment-actions">    {{actions}}  </span>{{/each}}

comment_callout helper

{{comment_callout}}

A link for users to create a new comment or a follow-up ticket, if allowed.

Availability

  • Article page
  • Request page

Example

{{comment_callout}}

Output

When placed in article page:

<!-- if comments are disabled -->Article is closed for comments.
<!-- if user not signed in -->Please <a href="/path_to_sign_in/">sign in</a> to leave a comment.
<!-- if signed in and there is no comments yet -->Be the first to write a comment.

follow_up helper

{{follow_up}}

A link to the parent request, if it exists.

Availability

  • New Request page

token_field helper

{{token_field 'identifier'}}

An input that turns into a field with tokens, providing input validation as well as fast input deletion.

Token field

Availability

Parameters

  • identifier (required, string) Depends on the page and the form that has the field. See identifiers.

Example

{{#form 'comment' class='comment-form'}}  {{#if help_center.request_ccs_enabled}}    {{token_field 'ccs' class="ccs-input"}}  {{/if}}  {{textarea 'body' rows='4'}}  {{input type='submit'}}{{/form}}

{{related_articles}}

A list of up to five related articles. See How is the Related articles list in Help Center populated? in the Support Help Center.

Availability

  • Article page

request_callout helper

{{request_callout}}

A link for users to create a request, if they are allowed.

Availability

  • Article page

Example

{{request_callout}}

Output

<!-- this is only displayed if user can submit a request -->Have more questions? <a href="/path_to_new_request/">Submit a request</a>

request_form helper

{{request_form wysiwyg=true}}

Displays a form to submit a support request. The form includes ticket fields as defined in the agent interface. For more information, see Adding custom fields to your tickets and support request forms in the Support Help Center.

Note that this is a different form than the form helper.

Attributes

  • wysiwyg (optional, boolean) whether or not to use a rich text editor for the description field of the request form. Default is false.

Availability

  • New Request page

request_list helper

{{request_list}}

Important: This helper is in beta. The helper cannot be modified with theme code yet. It inherits its color settings from the standard color settings in the theme.

Renders a list of requests.

Availability

  • Request List page

satisfaction helper

{{satisfaction}}

The satisfaction rating of the request, if any.

Availability

  • Request page

upload helper

{{upload}}

A file upload interface allowing visitors to upload files. Drag and drop is available only on browsers that support this HTML5 feature. Only one upload helper is valid per page.

Availability

Example

{{#form "comment"}}  ...  <div class="comment-attachments">    {{upload}}  </div>{{/form}}

wysiwyg helper

{{wysiwyg 'identifier'}}

A textarea that turns into a "wysiwyg" editor when it receives focus, allowing visitors to insert rich content. This helper is an enhanced version of the textarea). It accepts the same identifier as a parameter, but unlike the textarea, it does not accept attributes.

Availability

Parameters

  • identifier (required, string) the name of the field. Depends on the page and the form that has the field. See identifiers.

Example

{{#form "post"}}  ...  <div class="form-field">    {{wysiwyg 'details'}}  </div>{{/form}}

edit helper

{{edit}}

Inserts an "edit" button that allows the owner of the profile to edit his or her information.

Availability

  • User Profile page