Resources

Products

Customise layout and portal pages

Modified on: Mon, 23 Nov, 2026 at 5:32 PM

TABLE OF CONTENTS

Introduction to Handlebars (templating language)

Powered by Handlebars JS, the self-service portal provides a range of built-in helpers to assist with customization. In addition to standard Handlebars helpers, the portal includes custom helpers such as pagination, avatar, and renderfromapi to support your specific needs.


Partials

Partials serve as modular, reusable components that can be incorporated across various page templates. Common examples include:

  1. “loaders”: A partial implemented across templates to show loading indicators while API data is fetched.

  2. “ticket_new_form”: A partial utilized for displaying input fields within the new ticket creation interface.


You can utilize the provided default partials or build your own custom ones.


Note: These function as substitutes for "snippets" used in Liquid templates.


Placeholders / Params

The self-service portal features two categories of placeholders:

  • Global context placeholders: These can be utilized across any page template within the portal.

  • Dynamic / Local context placeholders: These are scoped to specific pages and typically correspond to the server API response parameters for that particular page.


Helpers

Default Helpers

length

Returns the length of the given string or array.


Params

  • value {Array|Object|String}

  • returns {Number}: The length of the value.

default

Returns the first value that is not undefined, otherwise the "default" value is returned.


Params

  • value {any}

  • defaultValue {any}

  • returns {String}

eq

Block helper that renders a block if a is equal to b. If an inverse block is specified it will be rendered when falsy. You may optionally use the compare="" hash argument for the second value.


Params

  • a {String}

  • b {String}

  • options {Object}: Handlebars provided options object

  • returns {String}: Block, or inverse block if specified and falsey.

gt

Block helper that renders a block if a is greater than b.


If an inverse block is specified it will be rendered when falsy. You may optionally use the compare="" hash argument for the second value.


Params

  • a {String}

  • b {String}

  • options {Object}: Handlebars provided options object

  • returns {String}: Block, or inverse block if specified and falsey.

lt

Block helper that renders a block if a is less than b.


If an inverse block is specified it will be rendered when falsy. You may optionally use the compare="" hash argument for the second value.


Params

  • context {Object}

  • options {Object}: Handlebars provided options object

  • returns {String}: Block, or inverse block if specified and falsey.

lte

Block helper that renders a block if a is less than or equal to b.


If an inverse block is specified it will be rendered when falsy. You may optionally use the compare="" hash argument for the second value.


Params

  • a {String}

  • b {String}

  • options {Object}: Handlebars provided options object

  • returns {String}: Block, or inverse block if specified and falsey.

gte

Block helper that renders a block if a is greater than or equal to b.


If an inverse block is specified it will be rendered when falsy. You may optionally use the compare="" hash argument for the second value.


Params

  • a {String}

  • b {String}

  • options {Object}: Handlebars provided options object

  • returns {String}: Block, or inverse block if specified and falsey.

ternary

Returns either of the two values provided based on the condition given.


Params

  • Condition {Boolean}

  • trueValue {String | Number}

  • falseValue {String | Number}

  • returns {String | Number}

isnt

Block helper that renders a block if a is not equal to b. If an inverse block is specified it will be rendered when falsy.


Params

  • a {String}

  • b {String}

  • options {Object}: Handlebars provided options object

  • returns {String}

not

Returns true if val is falsey. Works as a block or inline helper.


Params

  • val {String}

  • options {Object}: Handlebars provided options object

  • returns {String}

or

Block helper that renders a block if any of the given values is truthy. If an inverse block is specified it will be rendered when falsy.


Params

  • arguments {...any}: Variable number of arguments

  • options {Object}: Handlebars options object

  • returns {String}: Block, or inverse block if specified and falsey.

and

Helper that renders the block if both of the given values are truthy. If an inverse block is specified it will be rendered when falsy. Works as a block helper, inline helper or subexpression.


Params

  • a {any}

  • b {any}

  • options {Object}: Handlebars provided options object

  • returns {String}

startsWith

Block helper which tests whether a string begins with the given prefix and renders as if and else.


Params

  • prefix {String}

  • testString {String}

  • options {String}

  • returns {String}

ellipsis

Truncates a string to the specified length, and appends it with an ellipsis (…).


Params

  • str {String}

  • length {Number}: The desired length of the returned string.

  • returns {String}: The truncated string.

replace

Replace all occurrences of substring a with substring b.


Params

  • str {String}

  • a {String}

  • b {String}

  • returns {String}

lowercase

Lowercase all of the characters in the given string.


Params

  • str {String}

  • returns {String}

uppercase

Uppercase all of the characters in the given string. If used as a block helper it will uppercase the entire block. This helper does not support inverse blocks.


Params

  • str {String}: The string to uppercase

  • options {Object}: Handlebars options object

  • returns {String}

titleize

Title case the given string. From “this is sample text” to “This Is Sample Text”.


Params

  • str {String}

  • returns {String}

isEmpty

Inline, subexpression, or block helper that returns true (or the block) if the given collection is empty, or false (or the inverse block, if supplied) if the collection is not empty.


Params

  • collection {Object}

  • options {Object}

  • returns {String}

isObject

Return true if value is an object.


Params

  • value {String}

  • returns {Boolean}

isNumber

Return true if value is an object.


Params

  • value {String | Number}

  • returns {Boolean}


Custom Helpers

renderFromApi

A block helper that performs an API request. Upon completion—regardless of success or failure—it runs the specified block of code. Parameter configurations align with standard jQuery ajax options (excluding function parameters); please refer to the jQuery ajax documentation for details.


Params

  • url {String | Number}

  • Method {String}


Example:

{{#renderFromApi url="/support/v2/solutions/articles/popular" method="GET"}}

    <section id="solutions-banner">

      <h2>Trending Topics</h2>

      {{#this}}

        <a href="{{#if external_url}}{{external_url}}{{else}}/support/solutions/articles/{{id}}{{/if}}" class="card solution-card">

           <div class="elem-inline-mid">

             <h3>{{title}}</h3>

             <p>{{description}}</p>

      </div>

         </a>

      {{/this}}

    </section>

  {{/renderFromApi}}


avatar

Takes standard image tag parameters along with an additional parameter: name. It checks the specified URL for the user's profile image. If no profile picture is found, it renders the initial of the provided name over a randomly selected default image.


Example:

{{avatar name=user_info.full_name url=user_info.profile_pic class="user-profile-pic"}}


Pagination

The pagination helper functions as a block helper. It accepts the following parameters:


  • list: The collection of items to paginate.

  • id: Unique identifier for the pagination block.

  • paginationContainer: The navigation container ID where pagination links will be rendered.

  • class (optional): Additional CSS classes for styling.

  • perPage (optional): Specifies the number of items displayed per page.

  • page (optional): Sets the current page number.

  • params (optional): Additional request parameters.


Custom Events

To facilitate advanced customizations, the Self Service portal dispatches various events that can be monitored at either the document or container level.


Document Events

Events that can be monitored at the document level.


Example:

$(document).on('PageChange', function(e) {

  new FSToastr({

    message: 'New Page Alert',

    type: 'success'

  }, true, true);

  console.log(e.detail);

});


PageUpdate

Fires when the page is updated

PageChange

Fires when the page is changed

SearchOpen

Fires when the search overlay is opened

SearchClose

Fires when the search overlay is closed

SideModalOpen

Fires when the side modal window is opened

SideModalRendered

Fires when the side modal window is rendered

SideModalClosed

Fires when the side modal window is closed

ModalOpen

Fires when the modal opens (used in Add People / Delegate Approvals / Change password)

ModalClose

Fires when the modal closes (used in Add People / Delegate Approvals / Change password)


Container Events

Events that can be monitored at the container level.


Example:

$('#search-results').on('SearchResult', function(e) {

  new FSToastr({

    message: 'Search Results updated',

    type: 'success'

  }, true, true);

  console.log(e.detail);

});


DOM Container

Event

Description

#search-results

SearchResult

Fires when the search result is rendered

#menu-icon, .menu-trigger

MenuOpen

Fires when the menu opens

MenuClose

Fires when the menu closes

#ticket-attachments

AttachmentLoad

Fires when the user attaches a file

AttachmentDone

Fires when the attachment is uploaded

select

SelectOpen

Fires when the user opens a dropdown

SelectClose

Fires when the user closes a dropdown


Global placeholders

Accessible across all portal pages featuring a placeholder picker (excluding the Head and Custom stylesheet pages).


Requester

{{user_info.full_name}}

Requester name

{{user_info.first_name}}

Requester first name

{{user_info.last_name}}

Requester last name

{{user_info.email}}

Requester email

{{user_info.mobile}}

Requester phone number

{{user_info.address}}

Requester address

{{user_info.location_name}}

Requester location


Departments

{{#each user_info.departments}}{{/each}}

All departments (insert first)

{{name}}

Department name

{{description}}

Department description

{{head_name}}

Department head name

{{prime_user_name}}

Department prime user name

{{domains}}

Department domains

{{custom_fields.FIELD_NAME}}

Department custom fields (replace FIELD_NAME)


Service Desk

{{portal.name}}

Service Desk name

{{portal.currency}}

Service Desk currency

{{portal.contact_info}}

Service Desk contact info


Portal home

Global placeholders apply here alongside these page-specific placeholders.


Cards

{{title}}

Title

{{content}}

Content

{{img}}

Image url

{{url}}

Url


Announcement

{{title}}

Title

{{created_at}}

Created at

{{planned_start_date}}

Planned start date

{{user.name}}

User name

{{user.avatar_url}}

Avatar url


Announcements home

Global placeholders apply here alongside these page-specific placeholders.


Announcements

{{id}}

Announcement ID

{{title}}

Title

{{create_at}}

Created at

{{planned_start_date}}

Planned start date

{{user.name}}

User name

{{user.avatar_url}}

Avatar url


Announcement view

Global placeholders apply here alongside these page-specific placeholders.


Announcement

{{id}}

Announcement ID

{{title}}

Title

{{create_at}}

Created at

{{planned_start_date}}

Planned start date

{{user.name}}

User name

{{user.avatar_url}}

Avatar url

{{description}}

Description


Solutions home

Global placeholders apply here alongside these page-specific placeholders.


Categories

{{id}}

Category ID

{{name}}

Name

{{folders_count}}

Folders count


Solution category home

Global placeholders apply here alongside these page-specific placeholders.


Folders

{{id}}

Folder ID

{{name}}

Name

{{articles}}

Articles


Articles

{{id}}

Article ID

{{title}}

Title

{{external_url}}

External url

{{description}}

Description


Articles list

Global placeholders apply here alongside these page-specific placeholders.


Article List

{{id}}

Article ID

{{title}}

Title

{{external_url}}

External url

{{description}}

Description

{{modified_at}}

Modified at

{{other_folders}}

Other Folders


Other Folders

{{id}}

Folder ID

{{name}}

Name


Article view

Global placeholders apply here alongside these page-specific placeholders.


Article View

{{id}}

Article ID

{{title}}

Title

{{modified_at}}

Modified at

{{description}}

Description

{{category.id}}

Category ID

{{category.name}}

Category name

{{folder.id}}

Folder ID

{{folder.name}}

Folder name

{{voted_by_user}}

Voted by user

{{attachments}}

Attachments


Ticket details

Global placeholders apply here alongside these page-specific placeholders.


Ticket Details

{{ticket.human_display_id}}

Display ID

{{ticket.subject}}

Subject

{{ticket.status}}

Status

{{ticket.status_name}}

Status name

{{ticket.cc_emails}}

CC emails

{{ticket.ticket_type}}

Ticket type

{{ticket.source_name}}

Source name

{{ticket.created_at}}

Created at

{{ticket.status_updated_at}}

Status updated at

{{ticket.closed_at}}

Closed at

{{ticket.description_html}}

Description html

{{ticket.requested_catalog_items}}

Requested catalog items

{{ticket.requester_avatar}}

Requester avatar

{{ticket.requester_id}}

Requester ID

{{ticket.requester_name}}

Requester name

{{ticket.requester_status_name}}

Requester status name

{{ticket.responder_avatar}}

Responder avatar

{{ticket.responder_id}}

Responder ID

{{ticket.responder_name}}

Responder name

{{ticket.responder_title}}

Responder title

{{ticket.associated_assets}}

Associated assets

{{ticket.attachments}}

Attachments

{{ticket.cloud_files}}

Cloud attachments

{{ticket.notes}}

Notes

{{ticket.notes_count}}

Notes count


Requested catalog items

{{item_id}}

Item ID

{{name}}

Name

{{short_description}}

Short description

{{description}}

Description

{{cost}}

Cost

{{delivery_time}}

Delivery time

{{quantity}}

Quantity

{{location}}

Location

{{stage}}

Stage

{{loaned}}

Loaned

{{from_date}}

From date

{{to_date}}

To date


Attachments

{{id}}

Attachment ID

{{content_file_name}}

Content file name

{{content_content_type}}

Content type

{{content_file_size}}

Content file size

{{attachment_path}}

Url


Associated assets

{{display_id}}

Asset ID

{{name}}

Name


Ticket list

Global placeholders apply here alongside these page-specific placeholders.


Ticket Details

{{subject}}

Subject

{{human_display_id}}

Display ID

{{display_id}}

ID

{{created_at}}

Created at

{{responder_id}}

Responder ID

{{responder_name}}

Responder name

{{status.id}}

Status ID

{{status.name}}

Status name

{{source.id}}

Source ID

{{source.name}}

Source name


Pending approvals

Global placeholders apply here alongside these page-specific placeholders.


Pending Approvals

{{approvable.subject}}

Subject

{{approvable.human_display_id}}

Display ID

{{approvable.type}}

Type

{{approval_url}}

Url

{{approval_status}}

Status

{{source.id}}

Source ID

{{approvable.source_name}}

Source name


Common Asks

Changing the hero banner of the home page

Hero banner background image:

#hero-banner

{


background-image

:

url

(

'https://example.com/your-banner.jpg'

)

!important

;


}


.hero-banner-container

,

.hero-banner-container

:before

{


background

:

none

!important

;


}