Power Pages Liquid – Basics
Liquid Basics in Power Pages
Learn how Liquid syntax, filters, and tags work in Power Pages.
Liquid is a templating language recognizable by two sets of delimiters: {{ }} for output and {% %} for logic and control flow.
Output Statements
Output statements display values from objects or text inside double braces.
If the current user’s first name is Doug, this would produce:
This demonstrates how static text and dynamic values combine.
Using Filters
Filters modify output values. They are added using the pipe (|) symbol.
This example uses the upcase filter to convert text to uppercase and the date filter to show a formatted current date.
Tags for Logic and Control Flow
Logic tags let you define variables and conditional content.
{% if user %}
Hello, {{ user.firstname | upcase }}, from {{ product }}.
{% else %}
Greetings, visitor, from {{ product }}!
{% endif %}
This uses assign to define a variable, and if…else for conditions based on whether a user is signed in.
Time Example
You can show the current time using the date filter:
Power Pages evaluates this on the server and displays the local time format.
Summary
Liquid basics in Power Pages include output expressions, filters to modify output, and tags for logic and variables. These fundamentals are key for building more complex dynamic content in your portals.
Comments
Post a Comment