Objects

页面列表中可以使用的对象帮助岑ter templates. Click the page links in the left sidebar for the availability of the objects in different templates. To learn how to access object properties in your templates, seePropertiesin the introduction.

activity object

Theactivityobject has the following properties.

Name Type Description
label string The translated label showing the type and the time of the contribution made by the user
type string The type can becreated-article,created-postorcreated-comment
contribution object Acontributionobject related to the activity

article object

Thearticleobject has the following properties.

Name Type Description
id integer The id of the article
url string The URL of the article in Help Center
title string The title of the article
body text The body of the article
locale string The locale that the article is displayed in
promoted boolean 如果the article is promoted or not. False by default
internal boolean 如果the article has a "staff" user segment. SeeUser Segments
updated_at string The time the article was last updated
created_at string The time the article was created
edited_at string The time the article was last edited in its displayed locale
vote_sum integer The sum of upvotes (+1) and downvotes (-1), which may be positive or negative
vote_count integer The total number of upvotes and downvotes
upvote_count integer The number of up votes on this article
comment_count integer The number of comments on this article
comments_disabled boolean If comments are disabled or not
author object Auserobject describing the author of the article
vote helper Voting elements. Seevote helper
path_steps array An array ofpath_stepobjects describing the path to the article
labels array An array of articlelabelobjects

article comment object

The articlecommentobject has the following properties.

Name Type Description
id integer The id of the comment
body string The body of the comment
anchor string The anchor id of the comment
url string The URL of the comment
created_at string The time the comment was created
edited_at string The last time the comment was edited
pending boolean 如果the comment is pending approval or not
vote_sum integer The total sum of votes on this comment
vote_count integer The number of votes cast on this comment
author object Auserobject describing the author of the comment
editor object Auserobject describing the editor of the comment if the comment was edited
ticket object Aticketobject related to the comment, if available
actions helper Links to the actions available (depending of the account and the user) for the comment
vote helper Voting elements. Seevote helper

article label object

The articlelabelobject has the following properties.

Name Type Description
identifier string 的名字the label

attachment object

Theattachmentobject has the following properties.

Name Type Description
id integer The id of the attachment
url string The URL of the attachment
name string 的名字the attachment
size string The size of the attachment

badge object

Thebadgeobject has the following properties.

Name Type Description
id string The id of the badge
name string The badge's name
description string The badge's description
category_slug string The slug of the badge’s category
icon_url string The URL of the badge’s icon. Empty if the badge does not have an icon
assigned_at string The time the badge was awarded to the user

category object

Thecategoryobject has the following properties.

Name Type Description
id integer The id of the category
name string 的名字the category
description string The description of the category
url string The URL of the category in Help Center
sections array An array of categorysectionobjects

contribution object

Thecontributionobject has the following properties.

Name Type Description
id integer The id of the contribution
title string The title of the contribution
url string The URL of the contribution
object_type string The type of the contribution
type string The translated type of the contribution
vote_sum integer The total sum of votes on the contribution
last_activity_at string The time of the last activity on the contribution
created_at string 创建时的贡献
edited_at string The time the contribution was edited
status string The status of the contribution
status_name string The translated status of the contribution
status_dasherized string The contribution status with dashes instead of underscores
body string The body of the contribution
pending boolean Whether the contribution is pending for approval
official boolean Whether the contribution is marked as official
path_steps array An array ofpath_stepobjects
stats array An array ofstatobject
author object Theuserobject describing the author of the contribution
editor object Theuserobject describing the editor of the contribution

filter object

The filter object has the following properties.

Name Type Description
identifier string The filter's identifier
name string The filter's name
url string The URL of the filter
selected boolean 如果the filter is on or off by default
label string The label for the filter when is selected
count integer The number of records matching this filter

group object

Thegroupobject has the following properties.

Name Type Description
id integer The id of the group
name string 的名字the group

help_center object

Thehelp_centerobject has the following properties.

Name Type Description
name string 的名字the current Help Center
url string The URL of the current Help Center
locale string The locale in which the Help Center is being viewed
community_enabled boolean If community is enabled in the current Help Center
request_management_enabled boolean If end users can manage their requests in the current Help Center
request_ccs_enabled boolean If end users can add CCs to the requests in the current Help Center. See "Enable CCs for end users on Help Center" in the table inSetting permissions for CCs and followersin the Support Help Center

locale object

Thelocaleobject has the following properties.

Name Type Description
name string 的名字the locale
url string The URL of the locale
direction string The direction in which the language is read. Example: English is "ltr" (left to right) while Arabic is "rtl" (right to left)

path_step object

Thepath_stepobject has the following properties.

Name Type Description
name string 的名字the path step
url string The URL of the path step
target string The target in which the URL should be opened. Example:_selfor_blank

post object

You can use the following properties in anypostobject.

Name Type Description
id integer The id the post
title string The title of the post
url string The URL of the post in Help Center
details string The body of the post
created_at string The time the post was created
updated_at string The time the post was last updated
edited_at string The time the post was last edited
comment_count integer The number of comments on the post
follower_count integer The number of users following the post
vote_sum integer The total sum of votes on the post
vote_count integer The number of votes cast on the post
pending boolean 如果the post is pending approval or not
pinned boolean 如果the post is pinned
featured boolean 如果the post is featured
closed boolean Whether further comments are allowed
actions helper Partial rendering the actions possible on the post
status string The post status
status_dasherized string The post status with dashes instead of underscores
status_name string The post status translated
ticket object Aticketobject related to the post
author object Auserobject describing the author of the post
editor object Auserobject describing the editor of the post if the post was edited
vote helper Voting elements. Seevote helper
path_steps array An array ofpath_stepobjects describing the path to the post

post comment object

You can use the following properties in any postcommentobject.

Name Type Description
id integer The id the comment
anchor string The anchor id of the comment
url string The URL of the comment
vote_sum integer The total sum of votes on the comment
vote_count integer The number of votes cast on the comment
created_at string The time the comment was created
updated_at string The time the comment was last updated
edited_at string The time the comment was last edited
official boolean 如果the comment is official or not
pending boolean 如果the comment is pending approval or not
body string The body of the comment
actions helper Partial rendering the actions possible on the post
author object Auserobject describing the author of the comment
editor object Auserobject describing the editor of the comment if the comment was edited
ticket object Aticketobject related to the comment, if available
vote helper Voting elements. Seevote helper
internal boolean 如果the post is internal or not

related_article object

Therelated_articleobject has the following properties.

Name Type Description
url string The URL of the article in Help Center
title string The title of the article

request object

Therequestobject has the following properties.

Name Type Description
id integer The id of the request
url string The URL of the request in Help Center
subject string The subject of the request
description string The description of the request
updated_at string The time the request was last updated
created_at string The time the request was created
status string The status of the request
status_description string A description of the status of the request
status_name string The localized version of thestatusvalue
requester object Auserobject describing the requester author
due_at string When the task is due (only applies if the request is of type "task")
due_date string Same asdue_atbut Localized according to current locale.
type string The type of the request, "question", "incident", "problem", "task" or "none" if not assigned
type_name string The localized version of thetypevalue
type_title string The title shown to end users for the type field
priority string The priority of the request, "low", "normal", "high", "urgent" or "none" if not assigned
priority_name string The localized version of thepriorityvalue
priority_title string The title shown to end users for the priority field
followup_source_id integer The id of the previous request if this is a followup request
can_be_marked_as_solved boolean If user can mark the request as solved

Bothtypeandpriorityreturnfalsy如果字段是不可见的最终用户。

request comment object

The requestcommentobject has the following properties.

Name Type Description
id integer The id of the comment
anchor string The anchor id of the comment
created_at string The time the comment was created
body string The body of the comment
author object Auserobject describing the comment author
attachments array An array ofattachmentobjects

request field object

The request field object has the following properties.

Name Type Description
type string The type of the request field
title string The title of the request field
value any The value of the request field

search result object

The search result object has the following properties.

Name Type Description
title string The title of the search result
url string The URL of the search result
is_external boolean If true, the search result is an external content record
text string A relevant content snippet in the result, withtags applied to the search term and any HTML from the source removed
vote_sum integer The total sum of votes on this search result record
created_at string The time the search result record was created
edited_at string The time the search result record was last edited
comment_count integer The number of comments on this search result record
meta string Meta information for a search result record, e.g.: 'by John Rossi 6 months ago in Kitchen > Recipes'"
type string The type of the search result. Valid values are 'article', 'community_post', and 'external_content_record'
author object Auserobject describing the author of the search result record
path_steps array An array ofpath_stepobjects describing the path to the search result

section object

Thesectionobject has the following properties.

Name Type Description
id integer The id of the section
name string 的名字the section
description string The description of the section
url string The URL of the section in Help Center
article_count integer The number of articles in the section
more_articles boolean 如果there are more articles than the ones in the articles array (the current page)
articles array An array of up to 30articleobjects. Seemore_articlesabove. For sections displayed on category pages, an array of up to 6 article objects. For subsections displayed on section pages, an array of up to 5 article objects
sections array An array of section objects. This array is populated only for Guide Enterprise customers

settings object

Thesettingsobject has custom properties. The object maps theidentifierand value of the variables defined in the theme'smanifest.jsonfile. The property values can be changed using the theme's Settings panel in Guide. SeeCustomizing the Settings panelin the Guide documentation.

In the following example, thesettingsobject has a custom property with an identifier ofcolor_brand_text:

             
<divstyle="color:{{settings.color_brand_text}}">

Like any other object, you can also use thesettingsobject in a helper. Example:

             
{{#is settings.warnings_enabled "Yes"}}{{/is}}

In the example, thewarnings_enabledcustom property is alist type variablewith "Yes" and "No" options.

stat object

Thestatobject has the following property.

Name Type Description
label string The translated status showing the vote count of the contribution. For a post and article contribution, it also includes the comment and follower counts

subscription object

Thesubscriptionobject has the following properties.

Name Type Description
id integer The id of the subscription
title string The title of the subscribed record
url string The URL of the subscribed record
type string The type of the subscription. Can be article, section, topic
name string The localized string of the type of the subscription
following string The localized string of what types of content are followed
subscribe helper Dropdown menu with links for subscribing

ticket object

Theticketobject has the following properties.

Name Type Description
id integer The id of the ticket
url string The URL of the ticket

ticket form object

Theticket formobject has the following properties.

Name Type Description
id integer The id of the ticket form
url string The URL of the ticket form
display_name string 的名字the ticket form

topic object

You can use the following properties in anytopicobject.

Name Type Description
id integer The topic id
name string The topic name
url string The URL of the topic in Help Center
description string The description of the topic in Help Center
post_count integer The number of posts in the topic
follower_count integer The number of users following the topic
internal boolean 如果the topic is internal or not
updated_at string The time the topic was last updated
created_at string The time the topic was created

user object

Theuserobject has the following properties.

Name Type Description
name string 的名字the user
id integer The user id
url string The URL of the user in the agent interface
agent boolean 如果the user is an agent
avatar_url string The user's avatar URL
badges array An array ofbadgeobjects