Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Portal: Liquid undefined functions on Customer Self-Service demo

(1) ShareShare
ReportReport
Posted on by 2

Hi everyone,

I setup a Customer Self-Service demo portal in order to enhance the knowledge on CRM Portal customization. Running over all the site functionalities I encountered some undocumented behaviours of the portal. If  you have the possibility to access the demo I am talking about the Home of the WebSite (for those who cannot access the demo code I will cut and paste some WebTemplate LIQUID code). There are 3 sections on the Home WebPage which are related to the CRM KnowledgeArticle standard entity:

1. Most Popular Articles

2. Most Recent Articles

3. Top Rated Articles

these 3 sections are rendered each through a specific LIQUID WebTemplate, for each section this is the piece of code I would like to focus:

 1. Most Popular Articles --> {% assign popular_articles = knowledge.articles | popular: count,languagecode  %}

 2. Most Recent Articles --> {% assign recent_articles = knowledge.articles | recent: count,languagecode  %}

 3. Top Rated Articles --> {% assign top_articles = knowledge.articles | top: count,languagecode  %}

The undefined behavior are:

- Where is the knowledge class defined? I mean, on CRM there is an entity "knowledgearticles" but I didn't find a place for an association with the class "knowledge". LIQUID does not specify an object "knowledge" and the liquid reference (https://www.microsoft.com/en-us/dynamics/crm-setup-and-administration/entities.aspx) define a standard way to access an entity content i.e. "entities.account"

- Assuming  knowledge.articles is the list of knowledgearticles stored on the CRM, its content is filtered through a specific function respectively : popular, recent, top. Neither of this function is defined in LIQUID, furthermore it seems there is no way to define custom functions. So my second question is, where are this functions defined? Is it possible to define custom functions for a generic entity?

Hope to finde some answer. 

Thanks in Advance,

Paolo

*This post is locked for comments

  • Verified answer
    Colin V Profile Picture
    on at
    RE: Portal: Liquid undefined functions on Customer Self-Service demo

    Hi, these are undocumented liquid objects and filters so that is why it is seeming a little mysterious right now.

    knowledge is a predefined liquid object just like there is one for forums.  knowledge.articles is a attribute of the knowledge object which is an array of knowledgearticles.

    "|top: count,language" or "| recent: count,language" are filters applied to the knowledge.articles array which sort the array by the fields count and languagecode.

    These objects and filters are not accessible to you to modify, and you do not have the ability to build your own because they would need to be part of the web site code which you don't have access to.

    With the other liquid objects, filters, and tags though you can rebuild the knowledge object yourself with the entities object which will return single entity records by ID or with the fetchxml object which allows you to make fetchxml queries and return a list or array of entity records.  You could then iterate through that result set with the forloop object and output as you desire them.

    Take a read through the Dynamics 365 portals administrator guide and specifically the liquid template section.  There is also the old Adxstudio Community site documentation which will be very similar.

    community.adxstudio.com/.../liquid-templates

    I am doing some blog posts on liquid templates as well if those help - colinvermander.com/.../liquid-templates

    Colin

  • Community Member Profile Picture
    on at
    RE: Portal: Liquid undefined functions on Customer Self-Service demo

    Hi Paolo,

    thanks for your questions: I'm interested to those topics too. Waiting for answers from more experienced people.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans