Create a custom page template to render an RSS feed


Effective October 12, 2022, Power Apps portals is Power Pages. More information: Microsoft Power Pages is now generally available (blog)
We will soon migrate and merge the Power Apps portals documentation with Power Pages documentation.

In this example, we'll create a custom page template to render an RSS feed of news articles, using Liquid and a Web Template Page Template. More information: Store source content by using web templates

Step 1: Create a new Power Apps view

First, we'll create a new Power Apps view that we'll use to load the data for our feed. In this example, we'll make it a view on Web Pages, and use this table to store our articles. We can use this view to configure the sorting and filtering of results, and include as columns the table attributes that we want available in our Liquid template.

Edit a page template.

Step 2: Create a web template for RSS feed

In this step, we'll create a web template for our RSS feed. This template will be applied to a particular webpage in our website, so we'll use the title and summary of that page as the title and description of the feed. The we'll use the entityview tag to load our newly-created News Articles view. More information: Dataverse entity tags. Note that we also set the MIME Type field of the Web Template to application/rss+xml. This indicates what the response content type could be when our template is rendered.

Configure a web template for an RSS feed.

RSS Feed (Web Template)

<?xml version=1.0 encoding=UTF-8 ?>
<rss version=2.0>
    <title>{{ page.title | xml_escape }}</title>
    <description>{{ page.description | strip_html | xml_escape }}</description>
    <link>{{ request.url | xml_escape }}</link>
    {% entityview logical_name:'adx_webpage', name:'News Articles', page_size:20 -%}
      {% for item in entityview.records %}
          <title>{{ item.adx_name | xml_escape }}</title>
          <description>{{ item.adx_copy | escape }}</description>
          <link>{{ request.url | base | xml_escape }}{{ item.url | xml_escape }}</link>
          <guid>{{ | xml_escape }}</guid>
          <pubDate>{{ item.createdon | date_to_rfc822 }}</pubDate>
      {% endfor -%}
    {% endentityview %}

Step 3: Create a page template to assign RSS feed template

Now, we'll create a new page template, allowing us to assign our RSS feed template to any webpage in our website. Note that we deselect Use Website Header and Footer, as we want to take over rendering of the entire page response for our feed.

Configure a page template for an RSS feed.

Step 4: Create a web page to host RSS feed

Now all that's left is to create a new web page using the RSS Feed template to host our feed. When we request this new web page, we'll receive our RSS feed XML:

Example of an RSS feed.

In this example, we've seen how we can combine Liquid, Web Templates, Power Apps views, and portals content management features to create a custom RSS feed. The combination of these features adds powerful customization capabilities to any portal application.

See also

Create a custom page template by using Liquid and a web template page template
Render the list associated with the current page
Render a website header and primary navigation bar
Render up to three levels of page hierarchy by using hybrid navigation