---
title: "Page Builder Template Language Syntax"
type: "wiki"
space: "Axero Documentation"
author: "Anonymous User"
created: 2017-05-29T19:41:43Z
updated: 2026-10-02T16:18:04Z
url: "https://my.axerosolutions.com/spaces/5/axero-documentation/wiki/view/23109/page-builder-template-language-syntax"
---

# Page Builder Template Language Syntax

Page Builder template syntax is based on Handlebars.Net, a templating language that mixes HTML with placeholders Axero fills in. Use the functions on this page to create your own Page Builder templates and customize how content appears in widgets. The syntax gives you conditionals \(show something only when a condition is true\), iterators \(repeat something for each item in a list\), and variables that retrieve content and user data.

## Table of Contents

- Basic Widget Functions
    - Scoping CSS written in a template
- Widget Specific Tokens
    - Activity Ticker Widget
    - Button Widget
    - CAPTCHA Widget
    - Connected Devices Widget
    - Content List Widget
    - Field Widget
    - Filter Widget
    - People Widget
    - Poll Widget
    - RSS Widget
    - Search Widget
    - Section Widget
    - Space List Widget
    - Sync Folders Widget
    - Tag Cloud Widget
    - What's New Widget \(Deprecated\)
- Helper Functions
    - Comparison Helper
    - Date Helper
    - Even Helper
    - Logic Helpers
    - Math Helper
    - To Lowercase Helper
    - Replace Spaces With Hyphen Helper
    - Remove HTML Helper
    - Nested helpers examples

**Page Builder Template Example**

```
<div class="axero-widget axero-widget-entity-icon-list {{CustomCSSClass}} {{#if HideContainerBorder}}axero-widget-no-border{{/if}}">
    <div class="axero-widget-header">
        <h3>{{WidgetTitle}}</h3>
    </div>
    <div class="axero-widget-content">
        <ul>
    		{{#each Contents}}		<li>			<div class="entity-icon">				<i {{#if IsFeatured}}style="color:blue"{{/if}} class="{{EntityIconCssClass}}"></i>			</div>			<div class="entity-title">				<a title="{{{Title}}}" href="{{ContentURL}}">{{{Title}}}</a>				<br/>				<div class="small nobold">					{{EntityTypeText}} {{../Resources.GlobalByText}}: <a href="{{AuthorUserProfileURL}}">{{{AuthorUserDisplayName}}}</a>				</div>			</div>		</li>		{{/each}}	</ul></div>
</div>
```

**General syntax**

- Wrap a variable in `{{{` instead of `{{` to output its HTML without encoding it. You may need this to avoid double encoding.
- If block: `{{#if condition}} html {{/if}}`
- Close an each block: `{{/each}}`
- If-else block: `{{#if condition}} html {{else}} html {{/if}}`
- Get localized text: `{{Resources.ResourceKey}}` 
Note: Your intranet's localized content text is stored at the level of the widget. To use it in a nested context \(such as inside an `each` block\), add the prefix `../` to reach the higher context. For example: `{{../Resources.GlobalYesText}}.` List each key you use in the template's **Resource Keys CSV** field, or the token outputs nothing.

## Basic Widget Functions

| **Variable** | **Description** |
| --- | --- |
| \{\{CustomCSSClass\}\} | Your custom CSS class for the widget, taken from the widget's **Custom CSS class** property. Use it to scope any CSS you write in the template. See **Scoping CSS written in a template** below. |
| \{\{#if HideContainerBorder\}\} | Checks if **Hide Container Border** is checked |
| \{\{#if ShowWidgetHeader\}\} | Checks if **Show Header** is checked |
| \{\{#if ShowWidgetFooter\}\} | Checks if **Show Footer** is checked |
| \{\{SiteURL\}\} | The site URL |
| \{\{WidgetTitle\}\} | The widget's title |
| \{\{WidgetID\}\} | The widget's unique ID |

### Scoping CSS written in a template

A `<style>` block written inside a template is not limited to the widget that holds it. It lands in the page exactly as written, so its rules apply to every matching element on that page, including the site header.

This most often trips people up with navigation. The stock Navigation templates put the class `ax-nav-widget` on their lists, and a header built from Navigation widgets carries that same class. As a result, a rule written for a navigation template's own classes restyles the header on every page that shows the widget.

To keep a template's CSS to itself, give the widget a **Custom CSS class** and start every selector in the style block with it:

```
<style>
  .my-nav .ax-nav-widget a { color: #fff; }
  .my-nav .ax-nav-widget li { padding: 4px; }
</style>
```

Each selector in a comma-separated list needs its own prefix. For example, `.my-nav a, li` scopes the first selector but leaves the second one applying to the whole page.

## Widget Specific Tokens

### Activity Ticker Widget

| **Variable** | **Description** |
| --- | --- |
| \{\{\{PlaceholderHTML\}\}\} | The loading animation |
| \{\{Contents.SpaceID\}\} | The ID of the space to get activity from |
| \{\{Contents.TimeAgo\}\} | Whether the date display style is mixed mode \(true\) or short date \(false\) |
| \{\{Contents.UserID\}\} | The ID of the logged in user |
| \{\{Contents.WallContainer\}\} | Where the Activity Ticker sits: 1 on a profile, 2 on My Account, 3 in a space |

### Button Widget

| **Variable** | **Description** |
| --- | --- |
| \{\{#if Contents.OpenNewTab\}\} | If the link opens in a new tab |
| \{\{Contents.IconCSSClass\}\} | The CSS class for the icon |
| \{\{\{Contents.ngCode\}\}\} | The button link code |
| \{\{\{Contents.URL\}\}\} | The button URL |

### CAPTCHA Widget

| **Variable** | **Description** |
| --- | --- |
| x-model="content.CaptchaCode" | The CAPTCHA key code |
| \{\{Contents.ApplicationURL\}\} | The site URL |

### Connected Devices Widget

| **Variable** | **Description** |
| --- | --- |
| \{\{DeviceID\}\} | The device's unique ID |
| \{\{DeviceType\}\} | The device's type \(e.g. iOS\) |
| \{\{DateCreatedText\}\} | When the device was connected |

### Content List Widget

| **Variable** | **Description** |
| --- | --- |
| \{\{AuthorUserID\}\} | The content author's user ID |
| \{\{\{AuthorUserDisplayName\}\}\} | The content author's display name |
| \{\{AuthorUserAvatarImageURL\}\} | The content author's avatar image URL |
| \{\{AuthorUserProfileURL\}\} | The content author's absolute profile URL |
| \{\{Body\}\} | The content's body<br>To show the content body, you must first set [System Properties](https://my.axerosolutions.com/spaces/5/axero-documentation/wiki/view/22317/system-properties "System Properties") &gt; ElasticSearchIndexContentBodyLength to a non-zero value, then [Rebuild Search Index](https://my.axerosolutions.com/spaces/5/axero-documentation/wiki/view/22330/rebuild-search-index "Rebuild Search Index") <br>Note: The body comes from the search index, which stores only as many characters as ElasticSearchIndexContentBodyLength allows, so longer content is cut off |
| \{\{CategoryID\}\} | The content's category ID |
| \{\{CommentCount\}\} | The content's number of comments |
| \{\{ContentCategoryName\}\} | The content's category |
| \{\{ContentCategoryStub\}\} | The content's category URL stub |
| \{\{ContentCommentsURL\}\} | The content's comments section URL |
| \{\{ContentDetailImageURL\}\} | The content's absolute image URL \(Using this URL instead of \{\{ContentImageURL\}\} optimizes photos in a carousel widget\) |
| \{\{ContentID\}\} | The content's unique ID |
| \{\{ContentImageURL\}\} | The absolute image URL of the content |
| \{\{ContentStub\}\} | The content's URL stub |
| \{\{\{Contents\}\}\} | The widget's list of items. Use it with \{\{#each Contents\}\} or \{\{#if Contents\}\}; output on its own, it shows nothing useful |
| \{\{Contents.*n*\}\} | The *n*-th content in the widget \(Starting index is 0\) |
| \{\{ContentStatusID\}\} | The content's status ID \(e.g. 1 = Published, 2 = Draft, etc.\) |
| \{\{ContentURL\}\} | The content's relative URL |
| \{\{DateCreated\}\} | The content's creation date in the viewer's date and time format \(for example, 1/5/2020 1:04:05 PM in US English\) |
| \{\{DateCreatedString\}\} | The content's creation date \(mixed format\) |
| \{\{DatePublished\}\} | The content's publication date in the viewer's date and time format \(for example, 1/5/2020 1:04:05 PM in US English\) |
| \{\{DatePublishedString\}\} | The content's publication date \(mixed format\) |
| \{\{DateUpdated\}\} | The content's last update date in the viewer's date and time format \(for example, 1/5/2020 1:04:05 PM in US English\) |
| \{\{DateUpdatedString\}\} | The content's last update date \(mixed format\) |
| \{\{EntityIconCssClass\}\} | The CSS icon class for this entity type \(e.g. "icon-lightbulb" for Idea\) |
| \{\{EntityType\}\} | The content's type \(e.g. Article, File, ForumTopic, etc.\) |
| \{\{\{EntityTypeText\}\}\} | The content's type \(e.g. Article, File, Discussion, etc.\) |
| \{\{GrandParentContentStub\}\} | The URL stub of the content's grandparent \(e.g. URL stub of the forum group a discussion is in\) |
| \{\{#if IsAddedFromActivityStream\}\} | Checks if content was added from the wall |
| \{\{#if IsComment\}\} | Checks if content is a comment \(Returns true for messages\) |
| \{\{#if IsContentPubliclyAccessible\}\} | Checks if content is publicly viewable |
| \{\{#if IsFeatured\}\} | Checks if content is featured |
| \{\{#if IsSpaceLevel\}\} | Checks if content is in a space |
| \{\{#if ShowRating\}\} | Checks if rating is supported for the content |
| \{\{#if ShowViewCount\}\} | Checks if view count is supported for the content |
| \{\{#if ShowCommentCount\}\} | Checks if comment count is supported for the content |
| \{\{#if Summary\}\} | Checks if content has a summary |
| \{\{MetaDescription\}\} | The content's meta description |
| \{\{MetaTitle\}\} | The content's meta title |
| \{\{PageViews\}\} | A content's number of views |
| \{\{ParentContentID\}\} | The ID of the content's parent |
| \{\{ParentContentStub\}\} | The URL stub of the content's parent |
| \{\{ParentContentTitle\}\} | The name of the content's parent <br><ul><br><li>Files: Directory name</li><br><li>Discussions: Forum name</li><br><li>Wikis: Parent wiki</li><br></ul> |
| \{\{Rating\}\} | The content's rating |
| \{\{\{SpaceName\}\}\} | The space a content is in |
| \{\{SpaceURL\}\} | The relative URL of the space a content is in |
| \{\{\{Summary\}\}\} | The content's summary |
| \{\{TagIDCSV\}\} | A CSV list of the content's tag IDs |
| \{\{Tags\}\} | A CSV list of the content's tags |
| \{\{\{Title\}\}\} | The content's title |
| \{\{TotalChildRecords\}\} | The content's number of children<br><ul><br><li>Album: Number of photos</li><br><li>Wikis: Number of child wikis</li><br></ul> |
| \{\{UpdatedByAvatarImageURL\}\} | The avatar image URL of the user who last updated the content |
| \{\{UpdatedByUserDisplayName\}\} | The display name of the user who last updated the content |
| \{\{UpdatedByUserID\}\} | The user ID of the user who last updated the content |
| \{\{UpdatedByUsername\}\} | The username of the user who last updated the content |
| \{\{UpdatedByUserProfileURL\}\} | The user profile URL of the user who last updated the content |

#### **Content Specific Functions**

**Cases**

| **Variable** | **Description** |
| --- | --- |
| \{\{AssignedUserDisplayName\}\} | The assigned user's display name |
| \{\{WallPostToUserID\}\} | The assigned user's user ID. Cases carry it in this token; \{\{AssignedUserID\}\} outputs nothing. |
| \{\{AssigneUserProfileURL\}\} | The assigned user's profile URL. The token is spelled without the "d" in Assigned, exactly as shown. A template that uses the correct spelling outputs nothing. |
| \{\{CategoryURL\}\} | The URL of the case's project, filtered by the case's category \(the project URL plus `?SectionID=`\) |
| \{\{DueDate\}\} | The case's due date in the viewer's date and time format \(for example, 1/5/2020 1:04:05 PM in US English\) |
| \{\{\{Milestone\}\}\} | The case's milestone |
| \{\{MilestoneID\}\} | The case's milestone ID |
| \{\{MilestoneURL\}\} | The URL of the space cases filtered by the case's milestone |
| \{\{\{Priority\}\}\} | The case's priority |
| \{\{PriorityID\}\} | The case's priority ID |
| \{\{PriorityURL\}\} | The URL of the case's project, filtered by the case's priority \(the project URL plus `?PriorityID=`\) |
| \{\{\{StatusClass\}\}\} | The case status's CSS class |
| \{\{StatusURL\}\} | The URL of the case's project, filtered by the case's status \(the project URL plus `?StatusID=`\) |
| \{\{\{StatusText\}\}\} | The case's status |

**Discussions**

| **Variable** | **Description** |
| --- | --- |
| \{\{#if IsAnswered\}\} | Checks if the discussion has a post marked as the answer |
| \{\{#if IsSticky\}\} | Checks if the discussion is sticky |

**Events**

| **Variable** | **Description** |
| --- | --- |
| \{\{EventAddress\}\} | The event's address |
| \{\{EventCountryID\}\} | The country ID of the event's address |
| \{\{EventEndDate\}\} | The event's end date in the viewer's date and time format \(for example, 1/5/2020 1:04:05 PM in US English\). It has no adjustment for all-day events, so an all-day event's end reads as midnight of the following day |
| \{\{EventLocation\}\} | The event location \(venue name and full address\) |
| \{\{EventMetroID\}\} | The metro ID of the event's address |
| \{\{EventStartDate\}\} | The event's start date in the viewer's date and time format \(for example, 1/5/2020 1:04:05 PM in US English\), with no adjustment for all-day events |
| \{\{\{EventStartDateDayInMonth\}\}\} | An event's day of the month, always two digits, so the 5th comes through as `05` rather than `5` |
| \{\{\{EventStartDateMonthNameShort\}\}\} | An event's short month text \(e.g. Apr\), taken from the same adjusted start date as the day token above |
| \{\{EventStateID\}\} | The state ID of the event's address |
| \{\{EventTypeID\}\} | The event's event type ID |
| \{\{EventTypeName\}\} | The event's event type name |
| \{\{EventVenueName\}\} | The event's venue name |
| \{\{EventWhen\}\} | An event's time information \(e.g. 09/11/2016 1:00 PM to 3:00 PM \(Central Standard Time\)\) |
| \{\{EventZip\}\} | The zip code of the event's address |
| \{\{#if EventIsAllDay\}\} | Checks if an event is all day |
| \{\{#if EventIsPrivate\}\} | Checks if an event is private |
| \{\{#if IsRecurringTime\}\} | Checks if the instance of the event is a recurring instance. Returns false if the event is the primary instance. \(Applicable when the widget is filtered by Events and Upcoming Events is checked.\) |

On all-day events, the day and short month tokens do not always agree with the full start and end dates. For an all-day event, Axero shifts the start forward before reading the day and the short month. That way, the event does not read a day early for someone in a time zone west of the person who posted it. `{{EventStartDate}}` and `{{EventEndDate}}` carry no such shift. That is also why an all-day event's end date reads as midnight of the day after it finishes. Use `{{{EventStartDateDayInMonth}}}` and `{{{EventStartDateMonthNameShort}}}` when you are displaying a date to a reader, and keep the full dates for anything that needs the raw value.

**Files**

| **Variable** | **Description** |
| --- | --- |
| \{\{FileFullText\}\} | A file's text |

**Users**

| **Variable** | **Description** |
| --- | --- |
| \{\{RankImageURL\}\} | The user's rank image URL |
| \{\{ChatStatusCSSClass\}\} | The user's chat status CSS class \(e.g. status-online\) |
| \{\{ChatStatusText\}\} | The user's chat status \(e.g. Online\) |
| \{\{#if ConnectedToUser\}\} | Checks if the user is connected to the logged in user |

**Videos**

| **Variable** | **Description** |
| --- | --- |
| \{\{EmbedCode\}\} | The iframe embed code |
| \{\{EmbedURL\}\} | The Axero embed URL |
| \{\{ExternalContentType\}\} | The video's type \(e.g., YouTubeLink\) |

**Wall Posts**

| **Variable** | **Description** |
| --- | --- |
| \{\{WallPostToUserID\}\} | The user ID of the user the wall post is for |

### Field Widget

| **Variable** | **Description** |
| --- | --- |
| \{\{\{Contents.FieldHelpHTML\}\}\} | The field's help text |
| \{\{\{Contents.FieldHTML\}\}\} | The input HTML |
| \{\{Contents.FieldLabel\}\} | The field label |
| \{\{Contents.FieldStub\}\} | The field stub |
| \{\{Contents.FieldUseID\}\} | The field ID |
| \{\{\{Contents.FieldValue\}\}\} | The value saved in the field |
| \{\{\{Contents.ValidationMessage\}\}\} | The field's input warning message |

### Filter Widget

| **Variable** | **Description** |
| --- | --- |
| \{\{\{Contents.FieldHTML\}\}\} | The input HTML |
| \{\{Contents.FieldLabel\}\} | The field label |
| \{\{Contents.FieldStub\}\} | The field stub |
| \{\{Contents.FieldUseID\}\} | The field ID |

### People Widget

To get user profile field data in a people widget template, use the **Insert widget specific token** menu. A profile field token takes the form `{{{field:Field name}}}`. To check if a certain profile field has a value, use the format `{{#if ||field:Field name||}} Content {{else}} Alternate content {{/if}}`.

People Directory widgets require "User." before the variable \(e.g. `{{{User.UserInfoDisplayName}}}` \). 
Single person widgets require "Contents." before the variable. \(e.g. `{{{Contents.UserInfoDisplayName}}}` \)

A Selected People widget is a single person widget whenever exactly one person is picked, or when **Logged in user**, **Logged in user's boss**, or **Profile user's boss** is checked. Its template then receives one person in `Contents`, not a list. A template that loops with `{{#each Contents}}`, such as a copy of Featured Users, fails to render in that case, and the widget disappears from the page. To write one template that works with one person or several, check for a single person first:

```
<ul>
{{#if Contents.UserID}}
    <li><a href="{{Contents.ProfileURL}}">{{{Contents.UserInfoDisplayName}}}</a></li>
{{else}}
    {{#each Contents}}
    <li><a href="{{ProfileURL}}">{{{UserInfoDisplayName}}}</a></li>
    {{/each}}
{{/if}}
</ul>
```

| **Variable** | **Description** |
| --- | --- |
| \{\{AvatarImageURL\}\} | The user's absolute avatar image URL |
| \{\{DateFormat\}\} | The user's date format preference |
| \{\{DateJoined\}\} | The user's join date in the viewer's date and time format \(for example, 1/5/2020 1:04:05 PM in US English\) |
| \{\{DateJoinedString\}\} | The user's join date \(mixed format\) |
| \{\{DateLastVisited\}\} | When the user last visited the site in the viewer's date and time format \(for example, 1/5/2020 1:04:05 PM in US English\) |
| \{\{DateLastVisitedString\}\} | When the user last visited the site \(mixed format\) |
| \{\{DirectReportCount\}\} | The number of direct reports the user has |
| \{\{#each Contents.AllTime\}\} | Iterates through the top users of all time \(Only available in a Top People List widget, and filled only when this period's tab is the one being shown\) |
| \{\{#each Contents.LastThirtyDays\}\} | Iterates through the top users of the last 30 days \(Only available in a Top People List widget, and filled only when this period's tab is the one being shown\) |
| \{\{#each Contents.ThisWeek\}\} | Iterates through the top users of this week \(Only available in a Top People List widget, and filled only when this period's tab is the one being shown\) |
| \{\{#each Contents.Today\}\} | Iterates through the top users of today \(Only available in a Top People List widget, and filled only when this period's tab is the one being shown\) |
| \{\{EmailRecieve\}\} | The user's email notifications preference \(AllEmails, OnlyExternalEmails, NoExternalEmails, or NoEmails\) |
| \{\{\{ICQIM\}\}\} | The user's company name |
| \{\{#if ConnectedToUser\}\} | Checks if the user is connected to the logged in user |
| \{\{#if InOrgChart\}\} | Checks if the user is in the org chart |
| \{\{#if IsBirthday\}\} | Checks if the content is for a birthday |
| \{\{#if IsContactInfoVisible\}\} | Checks if the user's contact information \(phone, website, IM handles, addresses, and social profiles\) is visible on their profile |
| \{\{#if IsFeatured\}\} | Checks if the user is featured |
| \{\{#if IsIsolated\}\} | Checks if the user is isolated |
| \{\{#if IsOptInPromotionalEmails\}\} | Checks if the user has agreed to receive promotional emails |
| \{\{#if IsProfileCompleted\}\} | Checks if the user's profile is completed |
| \{\{#if IsProfilePublic\}\} | Checks if the user's profile is public |
| \{\{#if UserIsActivated\}\} | Checks if the user's account is activated |
| \{\{#if ShowEmail\}\} | Checks if the user's email is shared |
| \{\{LastChatActivityDate\}\} | The user's last chat activity date and time \(in UTC\) |
| \{\{NextAnniversaryString\}\} | The user's nearest upcoming birthday or anniversary |
| \{\{NumPosts\}\} | The number of forum topics and posts made by the user |
| \{\{OnlineChatStatus\}\} | The user's chat status |
| \{\{Points\}\} | The user's number of points |
| \{\{ProfileImageURL\}\} | The user's profile image URL |
| \{\{ProfileURL\}\} | The user's absolute profile URL |
| \{\{RankID\}\} | The user's rank ID |
| \{\{RankImageURL\}\} | The user's rank image |
| \{\{\{RankName\}\}\} | The user's rank |
| \{\{Signature\}\} | The user's signature |
| \{\{SpaceDigestOption\}\} | The user's digest email preferences \(AllDigests, WeeklyDigestOnly, DailyDigestOnly, or NoDigests\) |
| \{\{#unless IsBirthday\}\} | Checks if the content is for a work anniversary, not a birthday |
| \{\{TimeFormat\}\} | The user's time format preference |
| \{\{TimeZoneID\}\} | The user's time zone ID |
| \{\{User.ChatStatusText\}\} | The user's online status \(e.g. Online\) |
| \{\{UserEmail\}\} | The user's email |
| \{\{UserFirstName\}\} | The user's first name |
| \{\{UserID\}\} | The user's unique ID |
| \{\{\{UserInfoDisplayName\}\}\} | The user's display name |
| \{\{UserLastName\}\} | The user's last name |
| \{\{UserMiddleName\}\} | The user's middle name |
| \{\{UserName\}\} | The user's username |
| \{\{Years\}\} | Anniversary years |
| \{\{YearsString\}\} | Anniversary display string \(e.g. 17 years served\) |

### Poll Widget

| **Variable** | **Description** |
| --- | --- |
| \{\{#each Contents.PollChoices\}\} | Iterates through poll choices |
| \{\{\{Choice\}\}\} | A poll choice's text |
| \{\{ChoiceID\}\} | A poll choice's unique ID |
| \{\{Contents.PollUrl\}\} | The poll's URL |
| \{\{Contents.PollVote.ChoiceID\}\} | The user's chosen answer in the poll |
| \{\{Contents.PollID\}\} | The poll's unique ID |
| \{\{\{Contents.Question\}\}\} | The poll's question |
| \{\{Contents.UserProfileURL\}\} | The profile URL of the poll creator |
| \{\{\{Contents.UserDisplayName\}\}\} | The display name of the poll creator |

### RSS Widget

| **Variable** | **Description** |
| --- | --- |
| \{\{\{Author\}\}\} | The content's author |
| \{\{DatePublished\}\} | The content's publication date |
| \{\{ImageURL\}\} | The content's image |
| \{\{ItemURL\}\} | The content URL |
| \{\{\{Summary\}\}\} | The content summary |
| \{\{\{Title\}\}\} | The content title |

### Search Widget

| **Variable** | **Description** |
| --- | --- |
| \{\{Contents.SearchResultsPageURL\}\} | The search results URL |
| \{\{Contents.SpaceID\}\} | The ID of the space to search in |

### Section Widget

| **Variable** | **Description** |
| --- | --- |
| \{\{\{Contents.ChildWidgetHTML\}\}\} | The HTML for the widgets inside this widget |

### Space List Widget

| **Variable** | **Description** |
| --- | --- |
| \{\{CreatedBy\}\} | The user ID of the space creator |
| \{\{DateCreated\}\} | The date the space was created |
| \{\{\{Description\}\}\} | The space's description |
| \{\{#if AutoSubscribeEmail\}\} | Checks if "Auto-subscribe new members to daily summary emails" is checked |
| \{\{#if AutoSubscribeForums\}\} | Checks if "Auto-subscribe new/existing members to all forums" is checked |
| \{\{#if DisableWallEmailNotifications\}\} | Checks if "Disable email notifications \(sent to all members\) when a new wall post is made" is checked |
| \{\{#if EnableArticles\}\} | Checks if articles are enabled |
| \{\{#if EnableBlogs\}\} | Checks if blogs are enabled |
| \{\{#if EnableContentExpiration\}\} | Checks if content expiration is enabled |
| \{\{#if EnableContentReadConfirmation\}\} | Checks if required reading is enabled |
| \{\{#if EnableEvents\}\} | Checks if events are enabled |
| \{\{#if EnableEventsFromOtherSpacesInCalendar\}\} | Checks if "Enable showing events from other spaces in calendar" is checked |
| \{\{#if EnableFiles\}\} | Checks if files are enabled |
| \{\{#if EnableForums\}\} | Checks if discussions are enabled |
| \{\{#if EnableIdeas\}\} | Checks if ideas are enabled |
| \{\{#if EnableIssueTracker\}\} | Checks if cases are enabled |
| \{\{#if EnableJobs\}\} | Checks if jobs are enabled \(Deprecated\) |
| \{\{#if EnablePhotos\}\} | Checks if photos are enabled |
| \{\{#if EnableSurveys\}\} | Checks if polls and surveys are enabled |
| \{\{#if EnableTaskManager\}\} | Checks if tasks are enabled |
| \{\{#if EnableUpcomingBirthdaysControl\}\} | Checks if "Show upcoming birthdays and anniversaries for space" is checked |
| \{\{#if EnableVideos\}\} | Checks if videos are enabled |
| \{\{#if EnableWiki\}\} | Checks if wikis are enabled |
| \{\{#if IsArticleCommentWorkflowActive\}\} | Checks if article comment workflow is enabled |
| \{\{#if IsArticleWorkflowActive\}\} | Checks if article workflow is enabled |
| \{\{#if IsBlogEntryCommentWorkflowActive\}\} | Checks if blog comment workflow is enabled |
| \{\{#if IsBlogWorkflowActive\}\} | Checks if blog workflow is enabled |
| \{\{#if IsEventCommentWorkflowActive\}\} | Checks if event comment workflow is enabled |
| \{\{#if IsEventWorkflowActive\}\} | Checks if event workflow is enabled |
| \{\{#if IsFeatured\}\} | Checks if the space is featured |
| \{\{#if IsFileCommentWorkflowActive\}\} | Checks if file comment workflow is enabled |
| \{\{#if IsFileWorkflowActive\}\} | Checks if file workflow is enabled |
| \{\{#if IsForumPostWorkflowActive\}\} | Checks if forum reply workflow is enabled |
| \{\{#if IsForumWorkflowActive\}\} | Checks if forum workflow is enabled |
| \{\{#if IsIdeaCommentWorkflowActive\}\} | Checks if idea comment workflow is enabled |
| \{\{#if IsIdeaWorkflowActive\}\} | Checks if idea workflow is enabled |
| \{\{#if IsJobCommentWorkflowActive\}\} | Checks if job comment workflow is enabled \(Deprecated\) |
| \{\{#if IsJobWorkflowActive\}\} | Checks if job workflow is enabled \(Deprecated\) |
| \{\{#if IsPhotoCommentWorkflowActive\}\} | Checks if photo comment workflow is enabled |
| \{\{#if IsPhotoWorkFlowActive\}\} | Checks if photo workflow is enabled |
| \{\{#if IsVideoCommentWorkflowActive\}\} | Checks if video comment workflow is enabled |
| \{\{#if IsVideoWorkFlowActive\}\} | Checks if video workflow is enabled |
| \{\{#if IsWikiCommentWorkflowActive\}\} | Checks if wiki comment workflow is enabled |
| \{\{#if IsWikiWorkflowActive\}\} | Checks if wiki workflow is enabled |
| \{\{LandingPage\}\} | The relative URL of the space's landing page |
| \{\{ManageSpaceURL\}\} | The relative Manage Space URL for the space |
| \{\{MembershipType\}\} | The membership moderation type |
| \{\{ParentSpaceID\}\} | The ID of the parent space |
| \{\{\{ParentSpaceName\}\}\} | The name of the space's parent space |
| \{\{ParentSpaceURL\}\} | The URL of the space's parent space |
| \{\{SpaceIconURL\}\} | The space's featured image |
| \{\{SpaceID\}\} | The space's ID |
| \{\{SpaceImageURL\}\} | The space's absolute image URL |
| \{\{\{SpaceName\}\}\} | The space's name |
| \{\{SpaceURL\}\} | The space's relative URL |
| \{\{SpaceVisibility\}\} | The space's visibility \(e.g. Public\) |
| \{\{StatusID\}\} | The space's status<ul><br><li>PendingWorkflow = 0</li><br><li>Published = 1</li><br><li>Declined = 3</li><br></ul> |
| \{\{Stub\}\} | The space stub |
| \{\{TotalMembers\}\} | The number of space members |
| \{\{UserEmail\}\} | The email address of the space creator |
| \{\{UserFirstName\}\} | The first name of the space creator |
| \{\{UserID\}\} | The user ID of the space creator |
| \{\{UserLastName\}\} | The last name of the space creator |
| \{\{UserName\}\} | The username of the space creator |

### Sync Folders Widget

| **Variable** | **Description** |
| --- | --- |
| \{\{SpaceID\}\} | The space's ID |
| \{\{\{SpaceName\}\}\} | The space's name |

### Tag Cloud Widget

| **Variable** | **Description** |
| --- | --- |
| \{\{\{TagCount\}\}\} | A tag's use count |
| \{\{TagID\}\} | A tag's unique ID |
| \{\{\{TagName\}\}\} | A tag's name |
| \{\{TagURL\}\} | A tag's relative URL |

### What's New Widget \(Deprecated\)

| **Variable** | **Description** |
| --- | --- |
| \{\{\{ActivityText\}\}\} | Recent activity text \(e.g. " updated a photo: "\) |
| \{\{ContentThumbImageFullURL\}\} | The content's absolute thumbnail image URL \(Video, Photo\) |
| \{\{\{ContentTitle\}\}\} | The content title |
| \{\{EndDateText\}\} | An event's end date and time \(e.g. 12/17/2016 12:00 PM\) |
| \{\{StartDateText\}\} | An event's start date and time \(e.g. 12/17/2016 10:00 AM\) |
| \{\{ViewCount\}\} | The content's number of views |

**Iterator Functions**

These functions iterate through content.

- \{\{#each Contents\}\}
- \{\{#each Contents.Activities\}\}
- \{\{#each Contents.Articles\}\}
- \{\{#each Contents.Blogs\}\}
- \{\{#each Contents.Events\}\}
- \{\{#each Contents.ForumPosts\}\}
- \{\{#each Contents.Photos\}\}
- \{\{#each Contents.Videos\}\}
- \{\{#each Contents.Wikis\}\}

**If Functions**

These functions check content type.

- \{\{#if Contents.ShowArticles\}\}
- \{\{#if Contents.ShowBlogs\}\}
- \{\{#if Contents.ShowEvents\}\}
- \{\{#if Contents.ShowForumPosts\}\}
- \{\{#if Contents.ShowPhotos\}\}
- \{\{#if Contents.ShowVideos\}\}
- \{\{#if Contents.ShowWikis\}\}

## Helper Functions

### Comparison Helper

The comparison helper compares values and returns true or false.

```
{{#if (compare Variable "ComparisonValue")}} {{/if}}
```

Note: Integer comparison values do not need surrounding quotes.

"==" is the default operation in the compare helper. To use a different operator, add the operator in quotes between the variable and comparison value:

```
{{#if (compare Variable ">" ComparisonValue)}} {{/if}}
```

List of operators:

1. "=="
2. "!="
3. "&lt;"
4. "&gt;"
5. "&lt;="
6. "&gt;="

Examples:

```
{{#if (compare EntityType "Event")}}<div class="when">{{{EventWhen}}}</div>{{/if}}
```

```
{{#if (compare CommentCount ">" 0)}}<div class="comments">{{CommentCount}} comments</div>{{/if}}
```

### Date Helper

The date helper converts dates into different formats.

```
{{date DateTimeVariable "operation" "option"}}
```

DateTimeVariable should be a DateTime field \(e.g., EventStartDate\) instead of a datetime string. A datetime string has to be converted to DateTime first, which may not be as reliable.

| **Operation** | **Output** |
| --- | --- |
| day | The date \(e.g. the "26" in "June 26"\) |
| month | The month integer \(e.g. the "6" in June 27\) |
| year | The year integer \(e.g. 2018\) |
| hour | The hour integer \(e.g. 11\) |
| minute | The minute integer \(e.g. 30\) |
| dayofweek | The day of week \(e.g. "Sunday"\)<br>Add the option "short" \(in quotes\) to output the short version \(e.g. "Sun"\)<br>Note: Day of week texts are resources and can be customized in Localized Content |
| monthtext | The text for the month \(e.g. "September"\)<br>Add the option "short" \(in quotes\) to output the short version \(e.g. "Sep"\)<br>Note: Month texts are resources and can be customized in Localized Content |
| format | The format of the date \(e.g. Monday, June 15, 2009\)<br>For the available format options, see [Microsoft Standard Date and Time Format Strings](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings) |

Example:

```
{{date EventStartDate "dayofweek" "short"}}
```

### Even Helper

The even helper checks if a number is even and returns true or false.

```
{{#if (even Variable)}} {{/if}}
```

Example:

```
{{#if (even @index)}}class="even-child"{{/if}}
```

### Logic Helpers

The logic helpers perform boolean logic and return true or false.

```
{{#if (and (Case) (Case))}}
```

The logic helper can be followed by as many cases as you want to evaluate.

List of logic helpers:

1. and
2. or

Example:

```
{{#if (or (compare EntityType "Article") (compare EntityType "Blog"))}}
```

### Math Helper

The math helper does arithmetic and returns the value.

```
{{math Variable "+" Variable}}
```

List of operators:

1. "+"
2. "-"
3. "\*" \(also aliased as "x" and "X"\)
4. "/"
5. "^" \(to the power\)

You can also specify a number of places to round to:

```
{{math Variable "/" Variable 2}}
```

Example:

```
{{math ContentID "+" CommentCount}}
```

### To Lowercase Helper

The to lowercase helper converts text in a variable to lowercase.

```
{{{toLowerCase Variable}}}
```

Example:

```
{{{toLowerCase Title}}}
```

### Replace Spaces With Hyphen Helper

The replace spaces with hyphen helper converts all spaces in a variable into hyphens.

```
{{{replaceSpaceWithHyphen Variable}}}
```

Example:

```
{{{replaceSpaceWithHyphen Title}}}
```

### Remove HTML Helper

The remove HTML helper strips HTML tags from a variable and returns a plaintext version.

```
{{{removehtml Variable "htmltag"}}}
```

`htmltag` specifies the HTML tag to remove from the string. To remove all HTML instead, don't provide this parameter. \(See the second example below.\)

When you name a tag, the helper removes only tags that carry at least one attribute, such as a link with an `href`, and keeps the text inside them. A tag with no attributes, such as a plain `<b>`, is not removed cleanly. The tag name is matched from its first letters, so `"a"` can also catch a tag such as `<abbr>` that comes before a link. To strip every tag, leave the parameter out.

Examples:

```
{{{removehtml Description "a"}}}
```

```
{{{removehtml ContentBody}}}
```

In a Content List template, the content's body is `Body`, so the second example becomes `{{{removehtml Body}}}` there.

### Nested helpers examples

You can nest one helper inside another. Wrap each inner helper in parentheses.

Example 1: The removehtml helper is nested in the trim helper. It removes the HTML from the Description, and then the trim helper cuts the result to SummaryCharacterLength.

```
{{{trim (removehtml Description "a") ../SummaryCharacterLength}}}
```

Example 2: Nested logic helpers check that the content is an article and has a category ID of 15 or 16.

```
{{#if (and (compare EntityType "Article") (or (compare CategoryID 15) (compare CategoryID 16)))}}
```

Example 3: Nested tolowercase and replaceSpaceWithHyphen helpers convert the variable Title to lowercase, and then replace its spaces with hyphens.

```
{{{replaceSpaceWithHyphen (tolowercase Title)}}}
```

#### Related pages

- [Add Page Builder Template](https://my.axerosolutions.com/spaces/5/axero-documentation/wiki/view/22784/add-page-builder-template "Add Page Builder Template") \(to put the syntax to use in a template of your own\)
- [Page Builder Widgets](https://my.axerosolutions.com/spaces/5/axero-documentation/wiki/view/22710/page-builder-widgets "Page Builder Widgets") \(the widgets and the tokens each one carries\)
- [Rich Editor Templates Guide](https://my.axerosolutions.com/spaces/5/axero-documentation/wiki/view/26842/rich-editor-templates-guide "Rich Editor Templates Guide") \(the same syntax inside the rich editor\)
- [Page Builder Widget Templates](https://my.axerosolutions.com/spaces/5/axero-documentation/wiki/view/22684/page-builder-widget-templates "Page Builder Widget Templates") \(the other widget templates\)
