Hi @OliverRodrigues no problem! 😀
It's just what I'm trying, with this:
$(".entitylist.entity-grid").on("loaded", function () {
$(this).children(".view-grid").find("td[data-attribute='v_name']").each(function () {
var value = $(this).parent().attr("data-id");
//$(this).wrapInner("<a href=\"/page-test/?id="+value+"\"</a>");
$(this).wrapInner("<a onclick='showItems(`" + value + "`);'></a>");
});
});
The line I have commented out would pass the GUID of the record and reload the page. I don't want that, the idea is that I make that call to a function, in my case showItems(value) and I pass the GUID
And my question is: inside that function can I call Liquid code? and that liquid code has:
{% assign categories = entities['category'] %}
{% fetchxml options %}
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="v_post" />
<attribute name="v_postid" />
<attribute name="v_name" />
<order attribute="v_name" descending="false" />
<filter type="and">
<condition attribute="v_categoryid" operator="eq" value="{{categories.id}}">
</filter>
</entity>
</fetch>
{% endfetchxml %}
{% assign resultset = options.results.entities %}
{% for option in resultset %}
{{ option.name }}
{{ option.v_postid.name}}
{% endfor %} -->
Where to put all this liquid code? It can be a div created from the function.
Thank you for your reply.