User Profile page

The User Profile page template is rendered when a user selects My profile from the user menu in the top-right corner of any page in Help Center, or when they click the name of the author of a post, comment, or article.

Available properties

Name Type Description
description string The description of the user
post_count integer The number of posts created by the user
comment_count integer The number of comments created by the user
vote_count integer The number of votes created by the user
article_count integer The number of articles created by the user
total_activity integer The total number of articles, votes, posts, comments, and subscriptions created by the user
follower_count integer The number of followers of the user
following_count integer The number of people that this user is following
subscription_count integer The number of subscriptions created by the user
member_since timestamp The time at which the first contribution has been made by the user
last_activity_at timestamp The time of the last activity of the user
sorter_description string The description for each sorter
private_profile boolean If the Help Center user profiles setting is private
visible boolean Whether the user profiles setting is public. true for private user profiles only if the viewer is the owner of the profile or an is an agent
activities array An array of activity objects
current_sorter object The current sorter object
sorters array An array of filter objects for the page. See Sorters below
contributions array The array of contribution objects
filters array An array of filter objects for the page
current_filter object The current filter object
user object The user object

Available helpers

Name Description
subscribe A link to follow or unfollow new contributions by this user, See subscribe
edit A link that allows the user to edit her or his profile information, such as name, avatar, description, email or phone
actions A split button menu of possible actions to take on the current user profile. It is a replacement for the {{edit}} helper and should be used in its stead.
pagination Pagination links, See pagination helper
change_password Show the change password modal. See change_password helper

Filters

Iterating through the filters array of filter objects adds the following links in the table below to the page. In the tab names, n is the count.

Identifier Tab Name (en-us) Remarks
activities Activity overview
badges Badges (n) Included if User Badges is enabled.
articles Articles (n)
posts   Posts (n) Included if Community is enabled
comments Comments (n) Included if Community is enabled

Sorters

Iterating through the sorters array of filter objects adds the following links to the page:

Link text Action
Recent activity Sorts by the most recent activity in descending order. Activity are actions taken on the object, such as creating or updating it
Votes Sorts by the highest vote sum in descending order

Example

<header class="profile-header">
  <div class="profile-info">
    <div class="profile-avatar {{#if user.agent}}profile-avatar-agent{{/if}}">
      <img class="avatar" src="{{user.avatar_url}}" alt="Avatar"/>
    </div>
    <div class="basic-info">
      <h1 class="name">
        {{#if user.url}}
          <a href="{{user.url}}" target="_zendesk_lotus" title="{{t 'open_user_in_support'}}">{{user.name}}</a>
        {{else}}
          {{user.name}}
        {{/if}}
      </h1>
    </div>
    <div class="options">
      {{#if private_profile}}
        <span class="profile-private-badge">{{t 'private'}}</span>
      {{/if}}
      {{actions class='user-profile-actions split-button'}}
      {{subscribe}}
    </div>

    {{#if description}}
      <p class="description">{{description}}</p>
    {{/if}}

    <ul class="profile-stats profile-stats-activity">
      <li class="stat">
        <span class="stat-label">{{t 'total_activity'}}</span>
        <span class="stat-value">{{total_activity}}</span>
      </li>
      <li class="stat">
        <span class="stat-label">{{t 'last_activity'}}</span>
        <span class="stat-value">
          {{#if last_activity_at}}
            {{date last_activity_at timeago=true}}
          {{else}}
            {{t 'no_activity_yet'}}
          {{/if}}
        </span>
      </li>
      <li class="stat">
        <span class="stat-label">{{t 'member_since'}}</span>
        <span class="stat-value">
          {{#if member_since}}
            {{date member_since timeago=true}}
          {{else}}
            {{t 'no_activity_yet'}}
          {{/if}}
        </span>
      </li>
    </ul>
  </div>