Hi Experts,
I know how I can fetch the entity data using fetch xml by creating web template --> page template --> web page. And call that web page via ajax JS call.
But I am trying to use liquid code in the same web page to get the data and display it in the accordion way.
For example:
I have one entity from which I need to fetch the data, also there is a lookup field on which I have to apply to filter condition.
below is the sample code, with fetch xml which I know it is not working, so seeking help to understand how I can fetch the data using liquid code:
{% assign lang = website.selected_language.code %}
{% fetchxml feed %}
<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
<entity name='adx_portallanguage'>
<attribute name='adx_portallanguageid' />
<attribute name='adx_name' />
<filter type='and'>
<condition attribute='adx_languagecode' operator='eq' value='{{lang}}' />
</filter>
<link-entity name='cre08_customknowledgearticle' from='cre08_languagelookup' to='adx_portallanguageid' alias='KAlink'>
<attribute name='cre08_customknowledgearticleid' />
<attribute name='cre08_kanumber' />
<attribute name='cre08_title' />
<attribute name='cre08_keyword' />
<attribute name='cre08_description' />
<attribute name='cre08_content' />
<order attribute='createdon' descending='true' />
<filter type='and'>
<condition attribute='cre08_publishstatelookup' operator='eq' value='38c7d71a-31fd-4c2a-b7b0-fa2cc7381654' />
<condition attribute='cre08_kanumber' operator='ne' value='{{ "now" | date: "%Y-%m-%d %H:%M" }}' />
</filter>
</link-entity>
</entity>
</fetch>
{% endfetchxml %}
<div class="container">
<div class="row">
<div class="col-sm-12">
<div id="accordionParent">
{% for item in feed.results.entities %}
<button class="accordion">{{ item['KAlink.cre08_title']}} ( {{ item['KAlink.cre08_keyword'] }} )</button>
<div class="panel">
<p>{{ item['KAlink.cre08_content'] }}</p>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
The above fetchxml is working fine to fetch the data if I go with the web template --> page template --> web page and then calling that web page via ajax call in another page approach.
Can anyone help me to understand how I can do the same with liquid code? I have gone through the MS documentation but it was not very clear on how and from where to start.
Thanks,
Amit