cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mobicycle
Resolver I
Resolver I

Add Multiple Content Snippets to HTML Body

 

Can you please tell me what is wrong with this setup? I am trying to render content snippets

 

I have created a website, a web template for the website, a page template for the website, a webpage for the website and 4 content snippets.

Web Template

My web template shows

 

{% include 'snippet' snippet_name:'snippet1' %}

{% include 'snippet' snippet_name:'snippet2' %}

{% include 'snippet' snippet_name:'snippet3' %}

{% include 'snippet' snippet_name:'snippet4' %}
 

Content Snippets

snippet 1 - <p> I am snippet 1 </p>

snippet 2 - <p> I am snippet 2 </p>

snippet 3 - <p> I am snippet 3 </p>

snippet 4 - <p> I am snippet 4 </p>

 

Page Template

My page template

 

Website

My website

 

Webpage

My webpage

 

 

I have seen this documentation but it seems to be for one website and one content snippet.

 

Customize content by using content snippets - Power Apps | Microsoft Docs

After you create a snippet with text, HTML, or liquid objects shown in the example above, you can use it in a portal page.

To do add snippet on a portal page:

  1. Create a web template and use snippets liquid object to call the snippet you created.

  2. Create a page template using the web template created earlier.

  3. Use the portals Studio to create a new page using the page template created earlier.

 

1 REPLY 1
chleverenz
Super User
Super User

Hi @mobicycle ,

There are two ways to use snippets:

 

{{ snippets["snippet1"] }} or {% assign myname = "snippet1"%} {{ snippets[myname] }}

 

or

 

{% editable snippets "snippet1" type:html %} as documented here: https://docs.microsoft.com/en-

us/powerapps/maker/portals/liquid/portals-entity-tags#editable ( i am never sure, whether you have to quote the name here or not )

 

the former just reads them, the latter lets you edit them in the frontend if you are allowed to.

 

Keep in mind, that {{ }} usually renders something on the page and {% %} is usually a statement.

 

May be, that is the problem.

 

Does this help?

Have fun,

  Christian

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Users online (1,615)