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

How to Reference a Web File (HTML Content) in a Web Template using Liquid?

How would I reference a Web File in a Web Template using Liquid?

 

To reference a Content Snippet in a Web Template using Liquid, I would apparently enter 

 

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

1 ACCEPTED SOLUTION

Accepted Solutions

Can you try a different syntax:

 

{{ snippets['AccountData'] }}

 

Don't forget to clean the portal cache after making changes.

Also if you have multiple languages on the portal make sure that language of the snippet matches language of the open page. 

----------------------------------------------------
If you find this post helpful consider marking it as a solution to help others find it.

View solution in original post

6 REPLIES 6
OOlashyn
MVP

Hi @mobicycle ,

You cannot reference Web File in liquid. Web File can be accessed via URL that you specify for it. What exactly do you want to achieve?

----------------------------------------------------
If you find this post helpful consider marking it as a solution to help others find it.
mobicycle
Resolver I
Resolver I

I just wanted to know if it was possible to reference a Web File in a Web Template. 

 

Can you give an example of how you would reference the Web File in the Web Template?

 

I want this html code to appear where the reference is

 

<p> This is my sample code </p>

You can create a content snippet of HTML type and then reference it in your liquid code. 

----------------------------------------------------
If you find this post helpful consider marking it as a solution to help others find it.

I am aware of Content Snippets, which is why I wrote earlier - 

 

To reference a Content Snippet in a Web Template using Liquid, I would apparently enter 

 

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

 

This method did not work for me, however.

Can you try a different syntax:

 

{{ snippets['AccountData'] }}

 

Don't forget to clean the portal cache after making changes.

Also if you have multiple languages on the portal make sure that language of the snippet matches language of the open page. 

----------------------------------------------------
If you find this post helpful consider marking it as a solution to help others find it.

I have deleted the apps as I feel this platform is too early stage for me, and the customer support unsuitable, but I will mark your response as the solution as others may find it helpful.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call August 2022 768x460.png

Power Platform Community Call - August 2022

Join us for the next call on August 17, 2022 at 8am PDT.

Top Solution Authors
Users online (3,779)