Advanced helpers
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.
全球先进的助手
The following advanced helpers are available in all templates:
Shared advanced helpers
The following advanced helpers are only available in certain pages:
- actions
- comment_callout
- follow_up
- related_articles
- request_callout
- request_form
- request_list(beta)
- satisfaction
- token_field
- 上传
- wysiwyg
- edit
矩形ent_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 setscope='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 becommunity
,category
, orsection
. If set tocommunity
, displays the 5 most recently created community posts or post comments visible to the user. If set tocategory
orsection
, displays only recent activity for a category or section. Thecategory
andsection
工作范围只在类别和部分页面templates respectively.
Example
{{矩形ent_activity scope='section'}}
矩形ent_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
- Article page (within anarticle comment object)
- Post page (within apost objectand apost comment object)
Example
{{#each comments}}
...
<spanclass="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:
Article is closed for comments.
Please<ahref="/path_to_sign_in/">sign ina>to leave a comment.
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.
Availability
- Request page (within acomment form)
Parameters
identifier
(required, string) Depends on the page and the form that has the field. Seeidentifiers.
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 helper
{{related_articles}}
A list of up to five related articles. SeeHow 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
Have more questions?<ahref="/path_to_new_request/">Submit a requesta>
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, seeAdding custom fields to your tickets and support request formsin the Support Help Center.
Note that this is a different form than theform helper.
Attributes
wysiwyg
(optional, boolean) whether or not to use a rich text editor for thedescription
field of the request form. Default isfalse
.
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
上传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
- Request page (within acomment form)
Example
{{#form "comment"}}
...
<divclass="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 thetextarea). It accepts the sameidentifier
as a parameter, but unlike thetextarea
, it does not accept attributes.
Availability
- New post page (within apost form)
- Post page (within acomment form)
- Article page (within acomment form)
- Request page (within acomment form)
Parameters
identifier
(required, string) the name of the field. Depends on the page and the form that has the field. Seeidentifiers.
Example
{{#form "post"}}
...
<divclass="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