- 20 Jun 2024
- 3 Minutes to read
- DarkLight
Dynamic Pages Data
- Updated on 20 Jun 2024
- 3 Minutes to read
- DarkLight
Many pages on your your Members Portal display data pulled from your Nexudus account.
For example, the name of your space is displayed in the banner below.
We use a special syntax to get data from your account and add its elements on your Members Portal.
For example, to print the name of your space in the navigation bar we can do the following
The double curly braces **{{ data. }}** get the defined data from your account. In this case, it picks up Business.Name, which is the name of your space.
Each page has access to a set of data. For example, the page rendering the booking calendar has access to all the bookings made in the space along with all the events happening in the next 6 months.
It's important to remember that you can only print data that is available to the page you are editing. For example, if you are editing the Contact page, bookings data won't be available even if you add the relevant path.
What Data Is Available?
Not all data in your account is available to all pages in the space website. However, a certain data subset we call Common Data can be included on every page of your Members Portal.
For more information, check out Common Data.
Every page of your Members Portal also has a set of data that is only available to that page that we call Page-specific Data.
For more information, check out Page-specific Data.
Filters
Filters help you modify data before it is rendered on screen. You can use filters to format text, dates or number.
You use filters by adding a vertical bar (|) symbol followed by the filter. For example, the following snippet will display customer names in uppercase.
{{ data.Coworker.FullName | Upcase }}
Size
Return the size of an array or of a string.
{{ data.Coworker.Contracts | Size }}
Slice
Return a part of a string.
{{ data.Coworker.FullName | Slice: start, length }}
Downcase
Convert a input string to DOWNCASE.
{{ data.Coworker.FullName | Downcase }}
Upcase
Convert a input string to UPCASE.
{{ data.Coworker.FullName | Upcase }}
Capitalize
Capitalize words in the input sentence.
{{ data.Coworker.FullName | Capitalize }}
Escape
Encodes a string to be displayed in a browser.
{{ data.Coworker.FullName | Escape }}
OR
{{ data.Coworker.FullName | H }}
Truncate
Truncates a string down to N characters.
{{ data.Coworker.FullName | Truncate: N, "..." }}
Split
Split input string into an array of sub-strings separated by given pattern. Returns a list.
{{ data.Coworker.FullName | Split: 5, pattern }}
StripHtml
Removes any HTML mark-up from a string.
{{ data.Coworker.ProfileSummary | StripHtml }}
StripNewlines
Removes any HTML mark-up from a string.
{{ data.Coworker.ProfileSummary | StripNewlines }}
StripNewlines
Join elements of the array with a certain character between them.
{{ data.Coworker.Teams | Join: ", " }}
Sort
Sort elements of the array by a property.
{{ data.Coworker.Teams | Sort: 'Name'}}
Map
Map/collect on a given property.
{{ data.Coworker.Teams | Map: 'Name'}}
Replace
Replace occurrences of a string with another.
{{ data.Coworker.FullName | Replace: 'Jonathan', 'John'}}
ReplaceFirst
Replace the first occurence of a string with another.
{{ data.Coworker.FullName | ReplaceFirst: 'Jonathan', 'John'}}
Remove
Remove a substring.
{{ data.Coworker.Email | Remove: '@'}}
RemoveFirst
Remove the first occurrence of a substring.
{{ data.Coworker.Email | RemoveFirst: '@'}}
Append
Add one string to another.
{{ data.Coworker.Email | Append: ' (keep secret)'}}
Prepend
Prepend a string to another.
{{ data.Coworker.Email | Prepend: 'Reach me at: '}}
NewlineToBr
Add tags in front of all newlines in input string.
{{ data.Coworker.ProfileSummary | NewlineToBr }}
Date
Formats a date using a standard date format string.
{{ data.Coworker.CreatedOn | Date: 'yyyy-MM-dd' }}
First
Get the first element of a list.
{{ data.Coworker.Contracts | First }}
Last
Get the first element of a last.
{{ data.Coworker.Contracts | Last }}
Plus
Adds two numbers.
{{ data.Coworker.Contracts | Size | Plus: 10 }}
Minus
Substracts two numbers.
{{ data.Coworker.Contracts.size | Minus: 10 }}
Times
Multiplies two numbers.
{{ data.Coworker.Contracts.size | Times: 10 }}
DividedBy
Divides two numbers.
{{ data.Coworker.Contracts.size | DividedBy: 2 }}
AddDays
Adds a number of days to a date.
{{ data.Coworker.CreatedOn | AddDays: 10}}
AddMinutes
Adds a number of minutes to a date.
{{ data.Coworker.CreatedOn | AddMinutes: 10}}
Clean
Returns a SLUG url from a string.
{{ data.Coworker.FullName | Clean}}
Formats a string
Formats a string.
{{ 'Hello {0}' | FormatString: data.Coworker.FullName }}
FormatDecimal
Formats a decimal number.
{{ 'Price {0:0.00}' | FormatDecimal: data.Tariff.Price }}
FormatInteger
Formats a integer number.
{{ 'Price {0:0}' | FormatInteger: data.Contract.Quantity }}
FormatDate
Formats a date using a standard format string.
{{ 'Date of Birth {0:YYYY-MMM}' | FormatDate: data.Coworker.DateOfBirth }}
FormatDateString
Parses and date string and formats it using a standard format string.
{{ 'Date: {0:YYYY-MMM}' | FormatDateString: '2016-01-01' }}