Customer Engagement & Dynamics CRM Forum

Expand all | Collapse all

Liquid template to show entitylist inside the web pages

  • 1.  Liquid template to show entitylist inside the web pages

    TOP CONTRIBUTOR
    Posted Aug 28, 2019 01:41 PM
    ​Hi All,

    I am trying to show the portal web page with the Liquid template framework.

    I using below code:

    <div class="container">
      <div class="page-heading">
        {% include 'breadcrumbs' %}
      </div>
      {% include 'page_header' %}
      {% include 'page_copy' %}

      {% entitylist key: page.adx_entitylist.id %}
        {% entityview logical_name: 'new_product' name:'Vegetables' %}
         {% for item in entityview.records %}
            <item>
              <div name="content" style="padding: 15px 30px 0 0;">
                <h2> {{ item.new_name }} </h2>
                <h3> {{ item.new_description }} </h3>
              <div name="main-content" style="margin-left: 300px; max-width: 800px;">
               <p> {{ item.new_price}} </p>
               <br />
              </div>
            </item>
          {% endfor %}
        {% endentityview %}
      {% endentitylist %}
    </div>

    unfortunately it is not working. I have defined the entity list for the web page but page does not show entity list.

    Anybody knows what I am missing here?

    Thanks

    Regards

    ------------------------------
    Jeebo Mathews
    Agricorp
    ------------------------------
    Digital Acceleration Binge Day.  January 28th 2021 | 11:00 AM - 2:00 PM EST


  • 2.  RE: Liquid template to show entitylist inside the web pages

    D365UG/CRMUG ALL STAR
    Posted Aug 29, 2019 08:09 AM
    Hi Jeebo

    If you are surfacing CDS/Dynamics 365 data via Liquid in a Portal you need to setup Entity permission for those particular entities, or else the data will not show up.

    Even if you want to show for unauthenticated users, you need to create the entity permission and associate it to the anonymous user's web role.

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/portals/assign-entity-permissions

    https://docs.microsoft.com/en-us/learn/modules/secure-common-data-service-data-dynamics-365/2-cds-data-entity-permissions


    ------------------------------
    Nick Doelman
    Microsoft MVP
    Dynamics 365 Specialist
    Nick Doelman Co.
    ottawa ON
    ------------------------------

    Digital Acceleration Binge Day.  January 28th 2021 | 11:00 AM - 2:00 PM EST


  • 3.  RE: Liquid template to show entitylist inside the web pages

    Posted Dec 16, 2020 04:27 PM
      |   view attached
    Hi Nick,

    Read this post and your response with interest.

    I have a similar issue to Jeebo but I don't think my answer is entity permissions. I can get the entity list to show on a Web Page with one Page Template but when I change this to the Page template I want to use it stops appearing. The web template I want to use has the relevant lines of code (I think) to load the entity list control, the only key difference I can see if that the working Page/Web template combo uses the site Header and Footer whereas the Page/Web combo I want to use does not. Is something I need not getting loaded perhaps? Is there a permissions issue I'm missing based on Web templates?

    Any thoughts on where I should be looking gratefully received,

    Paul

    ------------------------------
    Paul Chapman
    Sainsbury Family Charitable Trusts
    London
    ------------------------------

    Digital Acceleration Binge Day.  January 28th 2021 | 11:00 AM - 2:00 PM EST


  • 4.  RE: Liquid template to show entitylist inside the web pages

    D365UG/CRMUG ALL STAR
    Posted Dec 17, 2020 11:30 AM

    Hey Paul,

    I suspect the issue lies in the web template and potentially if entity permissions are turned on or off on the entity list record.  It all becomes a tangled web (ha! pun) real fast.  

    When you create a web page, you choose a page template.  A page template is essentially a "pointer" to a web template or an aspx page.

    This structure is mostly because of legacy from the days before web templates.

    So if you change the page template, you will change what web template is used or might even point to a legacy aspx page.

    An entity list can be made visible in three ways:

    1. The lookup to the entity list on the webpage content record.  Some web templates and aspx pages are configured to show this entity list or not.
    2. Adding the list component to a page using the Portal studio (which adds a Liquid tag to the page copy for the webpage record)
    3. Specifying the entity list on the web template via Liquid or reference to lookup on web page (linked to page template, linked to the web page)

    When adding an entity list (either via the Portal studio or creating it via the portal management app) there is checkbox on whether to apply entity permissions or not.

    I am wondering if you are seeing an entity list on one page that has this shut off and when you switch out page templates, it shows another entity list with entity permissions turned on.

    I know this was a lot to unpack, but hopefully provides a bit of insight.

    The content available on MS Learn could provide some insight on how this is all wired together.

    https://docs.microsoft.com/learn/paths/extend-power-apps-portals/

    https://docs.microsoft.com/learn/paths/get-started-power-apps-portals/

    https://docs.microsoft.com/learn/paths/administer-portals/

    https://docs.microsoft.com/learn/paths/work-power-apps-portals/

    Cheers

    Nick



    ------------------------------
    Nick Doelman
    Microsoft MVP
    Power Platform/Dynamics 365 Specialist
    Nick Doelman Co.
    Ottawa
    ------------------------------

    Digital Acceleration Binge Day.  January 28th 2021 | 11:00 AM - 2:00 PM EST


If you've found this thread useful, dive deeper into User Group community content by role