Using Liquid in Power Pages – Step by Step guide

Using Liquid in Power Pages – Step by Step

Learn how to add a simple Liquid expression to a Power Pages site.

Example Used

The following Liquid expression displays the current time dynamically whenever the page is loaded.

Hello, visitor. The time is {{ 'now' | date: 'g' }}

Steps to Add This Liquid Example in Power Pages

Step 1: Open your Power Pages site using Design Studio.
Step 2: Navigate to the page where you want to display the Liquid content.
Step 3: Select the text component or section on the page.
Step 4: Paste the Liquid expression directly into the content area.
Step 5: Save the page and preview the site.

When the page loads, Power Pages evaluates the Liquid expression on the server and replaces it with the current time before sending the HTML to the browser.

Why This Works

Liquid is processed on the server side in Power Pages. The now keyword represents the current date and time, while the date filter formats the output.

This makes Liquid ideal for displaying dynamic information such as timestamps, greetings, or time-based messages without using JavaScript.

Summary

This simple example demonstrates how easy it is to use Liquid in Power Pages. By adding a single line of Liquid code, you can dynamically display server-generated content on your site.

Comments

Popular posts from this blog

Part 1: Creating Code Apps in Power Apps - A step-by-step guide (with real errors I faced & how I fixed them)

Calling Microsoft Graph API from Power Automate Using Azure App Services – Step-by-Step Guide

Step-by-Step Guide: Power Automate Custom Connector Using Graph API from Azure App Service