Page Builder template syntax is based on Handlebars.Net. Using the functions on this page, you can create your own Page Builder templates and customize how content appears in widgets. With conditionals, iterators, and variables that retrieve content and user data, the templates you can create are endless.
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
{{{
{{
{{#if condition}} html {{/if}}
{{/each}}
{{#if condition}} html {{else}} html {{/if}}
{{Resources.ResourceKey}}
each
../
{{../Resources.GlobalYesText}}.
Cases
Discussions
Events
Files
Users
Videos
Wall Posts
When creating a people widget template, use the Insert widget specific token menu to get any user profile field data. The template for profile fields is {{{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}} .
{{#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}}} )
{{{User.UserInfoDisplayName}}}
{{{Contents.UserInfoDisplayName}}}
Iterator Functions
These functions iterate through content.
If Functions
These functions check content type.
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:
Examples:
{{#if (compare EntityType "Event")}}<div class="when">{{{EventWhen}}}</div>{{/if}}
{{#if (compare CommentCount ">" 0)}}<div class="comments">{{CommentCount}} comments</div>{{/if}}
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, which requires converting to DateTime, which may not be as reliable.
The format of the date (e.g. Monday, June 15, 2009)The format options available can be seen in Microsoft Standard Date and Time Format Strings
Example:
{{date EventStartDate "dayofweek" "short"}}
The even helper checks if a number is even and returns true or false.
{{#if (even Variable)}} {{/if}}
{{#if (even @index)}}class="even-child"{{/if}}
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:
{{#if (or (compare EntityType "Article") (compare EntityType "Blog"))}}
The math helper does arithmetic and returns the value.
{{math Variable "+" Variable}}
You can also specify a number of places to round to:
{{math Variable "/" Variable 2}}
{{math ContentID "+" CommentCount}}
The to lowercase helper converts text in a variable to lowercase.
{{{toLowerCase Variable}}}
{{{toLowerCase Title}}}
The replace spaces with hyphen helper converts all spaces in a variable into hyphens.
{{{replaceSpaceWithHyphen Variable}}}
{{{replaceSpaceWithHyphen Title}}}
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 second example below.)
htmltag
{{{removehtml Description "a"}}}
{{{removehtml ContentBody}}}
Helpers can be nested within one another. Inner helpers should be wrapped in parentheses.
Example 1: The removehtml helper is nested in the trim helper. HTML is removed from Description, then the result is trimmed to SummaryCharacterLength.
{{{trim (removehtml Description "a") ../SummaryCharacterLength}}}
Example 2: Nested logic helpers. The content is checked to be an article and have 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. The variable Title is converted to lowercase, then spaces are replaced with hyphens.
{{{replaceSpaceWithHyphen (tolowercase Title)}}}
is requesting access to a wiki that you have locked: https://my.axerosolutions.com/spaces/5/communifire-documentation/wiki/view/23109/page-builder-template-language-syntax
Your session has expired. You are being logged out.