BC Liquid Comparisons

Below are some typical BC Liquid and tags you may be using and their closest Treepl CMS comparisons.

Item Data

BC: Page Name
{module_pagename}
eg: "About"

Treepl CMS:
{{this.name}}
Name of current item (within the context/scope of the template/layout where it is placed)
BC: Page Title
{module_pagetitle}
eg: "About ABC Company"

Treepl CMS:
{{this.seotitle}}
Meta title of current item (within the context/scope of the template/layout where it is placed)
BC: Page ID
{module_oid}
eg: "12345"

Treepl CMS:
{{this.id}}
ID of current item (within the context/scope of the template/layout where it is placed)
"this" Documentation

View full article

This Liquid object is globally accessible in every liquid template or layout and outputs specific data relating to the item being render.

{{ this }}

For example, if {{this}} is placed in a Page content area it will render the liquid data of that page. Likewise if placed in a Module content field, it will render the liquid data available for the specific module item being viewed.

Below is a live example of the {{this}} output for this very documentation article.

{
  "Id": 2324,
  "Url": "/liquid/this-object",
  "ParentId": 1881,
  "LastUpdatedDate": "2020-03-27T03:43:34",
  "Name": "{{ this }} object",
  "UrlSlug": "this-object",
  "Enabled": true,
  "ReleaseDate": "2018-08-04T00:00:00",
  "ExpiryDate": "2099-11-29T00:00:00",
  "Weighting": 985,
  "Description": "<p>This Liquid object is globally accessible in every liquid template or layout and outputs specific data relating to the item being render.</p>\n\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{data}}\", lang: \"liquid\" %}\n<p>For example, if <code>{{this}}</code> is placed in a Page content area it will render the liquid data of that page. Likewise if placed in a Module content field, it will render the liquid data available for the specific module item being viewed.</p>\n\n<p>Below is a live example of the <code>{{this}}</code> output for this very documentation article.</p>\n\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{this}}\", lang: \"json\" %}\n\n{% component type: \"snippet\", alias: \"section_accessing_data\" %}\n<p>As an example of rendering a desired value to the page you could use the following Liquid:</p>\n\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{data}}\", lang: \"liquid\" %}\n\n<p>This would output the value <code>/liquid/this-object</code> to the page based on the above data.</p>\n\n{% component type: \"snippet\", alias: \"section_viewing_data_while_developing\", object: \"this\", filter: \" | strip_html\" %}\n\n\n",
  "ItemTags": [
  "Liquid Usage"
],
  "Author_Name": "",
  "Author_Url": "",
  "Author": "",
  "SEOTitle": "",
  "MetaTitle": "",
  "MetaDescription": "",
  "ShowPageForSearchEngine": true,
  "CanonicalLink": "",
  "EnableAMP": false,
  "AMPContent": "",
  "CodeEditor": true,
  "ExternalId": 0,
  "SocialMetaTags": "",
  "OpenGraphProperties": {
  "title": "",
  "type": "",
  "url": "",
  "locale": "",
  "image": ""
},
  "DisableForSiteSearch": false,
  "SeoPriority": "",
  "CreatedByMemberId": 0,
  "ItemCategories": [
  "Sample Category"
],
  "ItemCategoryIdList": [
  "3"
],
  "SKUCode": "",
  "SiteSearchKeywords": "",
  "Active": true,
  "IgnoreUpdates": true,
  "UpdateNotes": "",
  "ExternalResources": "",
  "AdditionalRelatedArticle_Name": "",
  "AdditionalRelatedArticle_Url": "",
  "AdditionalRelatedArticle": "",
  "AdditionalRelatedArticle2_Name": "",
  "AdditionalRelatedArticle2_Url": "",
  "AdditionalRelatedArticle2": "",
  "Authors": "2418",
  "Pagination": {
  "CurrentPage": 1,
  "ItemsPerPage": 1,
  "NumberOfPages": 1,
  "TotalItemsCount": 1
},
  "Params": {},
  "Parent": {
  "Id": 2361,
  "Url": "/bc-migration-guides/bc-liquid-comparisons",
  "ParentId": 2355,
  "LastUpdatedDate": "2020-04-29T19:51:07",
  "Name": "BC Liquid Comparisons",
  "UrlSlug": "bc-liquid-comparisons",
  "Enabled": true,
  "ReleaseDate": "2019-02-28T00:00:00",
  "ExpiryDate": "2099-12-11T00:00:00",
  "Weighting": 700,
  "Description": "<p>Below are some typical BC Liquid and tags you may be using and their closest Treepl CMS comparisons.</p>\n\n  \n  <table style=\"width: 100%;\">\n    <thead>\n        <tr>\n            <th><h2 id=\"secItem\">Item Data</h2></th>\n        </tr>\n    </thead>\n    <tbody>      \n        \n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Page Name</b><br><code>{module_pagename}</code><br><small>eg: \"About\"</small>\n            <br class=\"space\"><br class=\"space\">\n            <b>Treepl CMS:</b><br><code>&#123;&#123;this.name&#125;&#125;</code><br><small>Name of current item (within the context/scope of the template/layout where it is placed)</small></td>\n        </tr>\n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Page Title</b><br><code>{module_pagetitle}</code><br><small>eg: \"About ABC Company\"</small>\n            <br class=\"space\"><br class=\"space\">\n            <b>Treepl CMS:</b><br><code>&#123;&#123;this.seotitle&#125;&#125;</code><br><small>Meta title of current item (within the context/scope of the template/layout where it is placed)</small></td>\n        </tr>\n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Page ID</b><br><code>{module_oid}</code><br><small>eg: \"12345\"</small>\n            <br class=\"space\"><br class=\"space\">\n            <b>Treepl CMS:</b><br><code>&#123;&#123;this.id&#125;&#125;</code><br><small>ID of current item (within the context/scope of the template/layout where it is placed)</small></td>\n        </tr>\n </tbody>\n</table>\n        <div class=\"tab-content faqsOpenCloseHolder\">\n    <div class=\"faqs-open-close \">\n        <a class=\"opener\" href=\"#\"><i class=\"fas fa-angle-right\"></i>\"this\" Documentation</a>\n        <div class=\"slide js-slide-hidden\">\n  {% component source: \"Documentation Post\", layout: \"Body Detail\", filterBy: \"id\", filterValue: \"2324\", limit: \"1\", type: \"module\" %}\n  </div>\n    </div>\n    </div>\n  <p><br><br></p>       \n        \n        \n        \n  \n  \n  \n  \n<table style=\"width: 100%;\">\n    <thead>\n        <tr>\n            <th><h2 id=\"secSystem\">System Data</h2></th>\n        </tr>\n    </thead>\n    <tbody>        \n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Page URL and URL Parameters</b><br><code>{module_url param=\"param1\"} and {module_pageaddress}</code><br><small>eg: {<br>\n  \"ID\": \"/test2.html\",<br>\n  \"question\": \"true\",<br>\n}</small>\n<br class=\"space\"><br class=\"space\">\n<b>Treepl CMS:</b><br><code>&#123;&#123;request.request_url&#125;&#125;</code><br><small>Output: {<br>\n    \"href\": \"https://docs.treepl.co/test2?question=true\",<br>\n    \"origin\": \"https://docs.treepl.co\",<br>\n    \"protocol\": \"https\",<br>\n    \"hostname\": \"docs.treepl.co\",<br>\n    \"path\": \"/test2\",<br>\n    \"params\": {<br>\n      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"question\": \"true\"<br>\n    &nbsp;&nbsp;&nbsp;&nbsp;}<br>\n    }</small></td>\n        </tr>\n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Referral Address</b><br><code>{module_referreraddress}</code><br><small>eg: \"http://mysite.com/page1\"</small>\n            <br class=\"space\"><br class=\"space\">\n            <b>Treepl CMS:</b><br><code>&#123;&#123;request.request_data.referrer&#125;&#125;</code><br><small>&nbsp;</small></td>\n        </tr>\n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Globals and Visitor IP Address</b><br><code>{module_visitoripaddress} and &#123;&#123;globals.visitor&#125;&#125;</code><br><small>eg: \"193.2.2.2\"<br><br>{<br>\n  \"deviceClass\": \"desktop\",<br>\n  \"ip\": \"193.2.2.2\",<br>\n  \"country\": \"RO\",<br>\n  \"userAgent\": \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.103 Safari/537.36\"<br>\n}</small>\n<br class=\"space\"><br class=\"space\">\n<b>Treepl CMS:</b><br><code>&#123;&#123;request.request_data&#125;&#125;</code><br><small>Output: {<br>\n    \"ip\": \"193.2.2.2\",<br>\n    \"is_mobile\": 0,<br>\n    \"user_agent\": \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.103 Safari/537.36\",<br>\n    \"referrer\": \"/page1\"<br>\n  }</small></td>\n        </tr>\n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Visitor Device Class</b><br><code>{system_visitordeviceclass}</code><br><small>eg: \"desktop\", \"phone\" or \"tablet\"</small>\n            <br class=\"space\"><br class=\"space\">\n            <b>Treepl CMS:</b><br><code>&#123;&#123;request.device_type&#125;&#125;</code><br><small>Output: \"Desktop\", \"Tablet\", \"Mobile\"</small></td>\n        </tr>\n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Logged In User</b><br><code>&#123;&#123;globals.user&#125;&#125; and {module_isloggedin}</code><br><small>eg: \"1\" or \"0\"<br><br>{<br>\n  \"firstname\": \"Alex\",<br>\n  \"lastname\": \"Smith\",<br>\n  \"fullname\": \"Alex Smith\",<br>\n  \"email\": \"asmith@example.com\",<br>\n  \"isLoggedIn\": true<br>\n}</small>\n<br class=\"space\"><br class=\"space\">\n<b>Treepl CMS:</b><br><code>&#123;&#123;request.is_logged&#125;&#125; and &#123;&#123;request.currentmember&#125;&#125;</code><br><small>Output: \"true\" or \"false\"<br><br>{<br>\n        \"id\": 162,<br>\n        \"email\": \"asmith@example.com\",<br>\n        \"firstname\": \"Alex\",<br>\n        \"lastname\": \"Smith\",<br>\n        \"address\": null,<br>\n        \"city\": null,<br>\n        \"state\": null,<br>\n        \"zipcode\": null,<br>\n        \"country\": \"Australia\",<br>\n        \"site\": null,<br>\n        \"phone\": null,<br>\n        \"createddatetime\": \"2018-11-21T15:17:22.717\",<br>\n        \"updateddatetime\": \"2018-11-21T15:17:22.763\",<br>\n        \"securezones\": [<br>\n            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>\n            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"id\": 2,<br>\n            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"name\": \"Members Secure Zone\",<br>\n            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"landingpageid\": 2541,<br>\n            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"createddatetime\": \"2018-11-21T15:17:23.037\",<br>\n            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"updateddatetime\": \"2018-11-21T15:17:23.037\"<br>\n            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>\n        &nbsp;&nbsp;&nbsp;&nbsp;]<br>\n    }</small></td>\n        </tr>\n         </tbody>\n</table>\n        <div class=\"tab-content faqsOpenCloseHolder\">\n    <div class=\"faqs-open-close \">\n        <a class=\"opener\" href=\"#\"><i class=\"fas fa-angle-right\"></i>\"request\" Documentation</a>\n        <div class=\"slide js-slide-hidden\">\n  {% component source: \"Documentation Post\", layout: \"Body Detail\", filterBy: \"id\", filterValue: \"1964\", limit: \"1\", type: \"module\" %}\n  </div>\n    </div>\n    </div>\n\n     \n     \n     \n     \n     \n        \n<table style=\"width: 100%;\">\n    <thead>\n        <tr>\n            <th><h2 id=\"secContent\">Content Modules</h2></th>\n        </tr>\n    </thead>\n    <tbody>      \n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: WebApp listing module</b><br><code>{module_webapps render=\"item|collection\" id=\"webappId|webappName\" filter=\"item\" itemId=\"123\" targetFrame=\"\" resultsPerPage=\"\" hideEmptyMessage=\"false\" rowCount=\"\" sortType=\"ALPHABETICAL\" collection=\"my_custom_collection_name\" template=\"/folder/template.tpl\"}</code><br><small>eg: <ul>\n    <li>My WebApp Item 1</li>\n    <li>My WebApp Item 2</li>\n    <li>My WebApp Item 3</li>\n</ul></small>\n<br class=\"space\"><br class=\"space\">\n<b>Treepl CMS:</b><br><code>{% component type: \"module\", object: \"item|collection\", source: \"&lt;Custom Module name/ID&gt;\", filterBy: \"id\", filterValue: \"123\", limit: \"10\", emptyMessage: \"&lt;your content&gt;\", sortBy: \"name\", collectionVariable: \"my_custom_collection_name\", layout: \"List 1\" %}</code><br><small>Notes: No \"targetFrame\" or \"rowCount\" equivalents as no longer necessary.<br>Fully documented Component parameters below.</small></td>\n        </tr>\n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Blog's Post listing module</b><br><code>{module_blogpostlist render=\"item|collection\" collection=\"my_custom_collection_name\" template=\"/folder/template.tpl\" blogId=\"12345\" rowCount=\"10\" tag=\"tag\"}</code><br><small>eg: <ul>\n    <li>My Blog Post 1</li>\n    <li>My Blog Post 2</li>\n    <li>My Blog Post 3</li>\n</ul></small>\n<br class=\"space\"><br class=\"space\">\n<b>Treepl CMS:</b><br><code>{% component type: \"module\", object: \"item|collection\", collectionVariable: \"my_custom_collection_name\", layout: \"List\", filterBy: \"parentid\", filterValue: \"12345\", source: \"Blog Post\" %}</code><br><small>Notes: No \"rowCount\" equivalent as no longer necessary. Tag filtering can by done via teh \"filterBy\" parameter or via Liquid conditions in the layout or collection.<br>Fully documented Component parameters below.</small></td>\n        </tr>\n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Form module</b><br><code>{module_webform id=\"1234\"\"}</code><br><small>eg: <ul>\n    <li>My Menu Item 1</li>\n    <li>My Menu Item 2</li>\n    <li>My Menu Item 3</li>\n</ul></small>\n<br class=\"space\"><br class=\"space\">\n<b>Treepl CMS:</b><br><code>{% component type: \"menu\", alias: \"&lt;menu_alias&gt;\" %}</code><br><small>Fully documented Component parameters below.</small></td>\n        </tr>\n </tbody>\n</table>       \n    \n   \n   <div class=\"tab-content faqsOpenCloseHolder\">\n    <div class=\"faqs-open-close \">\n        <a class=\"opener\" href=\"#\"><i class=\"fas fa-angle-right\"></i>Custom Module Component Documentation</a>\n        <div class=\"slide js-slide-hidden\">\n   {% component source: \"Documentation Post\", layout: \"Body Detail\", filterBy: \"id\", filterValue: \"1960\", limit: \"1\", type: \"module\" %}\n   </div>\n    </div>\n    </div>\n   \n   <div class=\"tab-content faqsOpenCloseHolder\">\n    <div class=\"faqs-open-close \">\n        <a class=\"opener\" href=\"#\"><i class=\"fas fa-angle-right\"></i>Blog Post Component Documentation</a>\n        <div class=\"slide js-slide-hidden\">\n   {% component source: \"Documentation Post\", layout: \"Body Detail\", filterBy: \"id\", filterValue: \"2142\", limit: \"1\", type: \"module\" %}\n   </div>\n    </div>\n    </div>\n   \n   \n   <div class=\"tab-content faqsOpenCloseHolder\">\n    <div class=\"faqs-open-close \">\n        <a class=\"opener\" href=\"#\"><i class=\"fas fa-angle-right\"></i>Menu Component Documentation</a>\n        <div class=\"slide js-slide-hidden\">\n   {% component source: \"Documentation Post\", layout: \"Body Detail\", filterBy: \"id\", filterValue: \"1958\", limit: \"1\", type: \"module\" %}\n   </div>\n    </div>\n    </div>\n  <p><br><br></p>      \n        \n        \n        \n        \n\n\n\n<table style=\"width: 100%;\">\n    <thead>\n        <tr>\n            <th><h2 id=\"secSyntax\">Dates, Filters &amp; General Syntax</h2></th>\n        </tr>\n    </thead>\n    <tbody>\n        \n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Current Date (from server)</b><br><code>&#123;&#123; globals.site.dateNow | datetime &#125;&#125;</code><br><small>eg: \"09-Jan-2015 02:46 PM\"</small>\n            <br class=\"space\"><br class=\"space\">\n            <b>Treepl CMS:</b><br><code>&#123;&#123; \"now\" | date: \"%d-%b-%Y %I:%M %p\"  &#125;&#125;</code><br><small>Date formatting examples in the Liquid documentation <a href=\"https://shopify.github.io/liquid/filters/date/\" target=\"_blank\">here</a>, a very useful tool for generating date formats can be found at <a href=\"http://strftime.net/\" target=\"_blank\">STRFTIME.net</a></small></td>\n        </tr>\n  </tbody>\n</table>      \n        <div class=\"tab-content faqsOpenCloseHolder\">\n    <div class=\"faqs-open-close \">\n        <a class=\"opener\" href=\"#\"><i class=\"fas fa-angle-right\"></i>Liquid Syntax Documentation</a>\n        <div class=\"slide js-slide-hidden\">\n    {% component source: \"Documentation Post\", layout: \"Body Detail\", filterBy: \"id\", filterValue: \"2128\", limit: \"1\", type: \"module\" %}\n    </div>\n    </div>\n    </div>\n  <p><br><br></p>\n  \n   ",
  "ItemTags": [
  "Migrations"
],
  "Author_Name": "",
  "Author_Url": "",
  "Author": "",
  "SEOTitle": "",
  "MetaTitle": "",
  "MetaDescription": "",
  "ShowPageForSearchEngine": true,
  "CanonicalLink": "",
  "EnableAMP": false,
  "AMPContent": "",
  "CodeEditor": true,
  "ExternalId": 0,
  "SocialMetaTags": "",
  "OpenGraphProperties": "",
  "DisableForSiteSearch": false,
  "SeoPriority": "",
  "CreatedByMemberId": 0,
  "ItemCategories": "",
  "ItemCategoryIdList": "",
  "SKUCode": "",
  "SiteSearchKeywords": "",
  "Active": true,
  "IgnoreUpdates": true,
  "UpdateNotes": "Added external resource link for BC to Treepl App conversion info.",
  "ExternalResources": "<ul><li><a href=\"https://forum.treepl.co/t/bc-to-treepl-app-updates-announcements-and-discussions/497\" rel=\"noopener noreferrer\" target=\"_blank\" title=\"\">BC to Treepl CMS App - Liquid and Tag Conversions</a></li></ul>",
  "AdditionalRelatedArticle_Name": "",
  "AdditionalRelatedArticle_Url": "",
  "AdditionalRelatedArticle": "",
  "AdditionalRelatedArticle2_Name": "",
  "AdditionalRelatedArticle2_Url": "",
  "AdditionalRelatedArticle2": "",
  "Authors": "2418",
  "ParentName": "BC Migration Guides",
  "ParentUrl": "/bc-migration-guides",
  "TemplateName": "Docs Template",
  "IsHome": false
}
}

Accessing the Data

As an example of rendering a desired value to the page you could use the following Liquid:

{{ this.url }}

This would output the value /liquid/this-object to the page based on the above data.

Viewing Data while Developing

It is often desirable to see all the data that is available to you on a page while developing your applications and there are two common techniques for doing this.

1. Rendering JSON to the Page

You can quickly and easily render the full JSON output directly to the page you are working on in order to view all the data and its structure in an easy to read format.
Simply wrap your desired Liquid object in <pre> tags like so; <pre>{{this}}</pre>

A JSON representation of the available data will be rendered to the page similar to the output examples above.

You can actually use this method to log any Liquid data to the console, such as a custom collection, for example: <pre>{{myCustomCollection}}</pre>

This of course is a temporary technique as you would not want to leave the JSON data visible on the page.

2. Rendering JSON to the Console

Perhaps a cleaner and more persistent way of viewing this data while in development, is to log the JSON output to your browser's console (in the browser's Developer Tools).

To do this, add some javascript code to your template file (just before the closing </body> tag) like this:

<script>
    console.log({{this | strip_html}});
</script>

What this will do is output the JSON data into a structured data tree in your browser's Developer Tools console.

You can actually use this method to log any Liquid data to the console, such as a custom collection, for example:

<script>
    console.log({{myCustomCollection | strip_html}});
</script>

You might notice the Liquid filter | strip_html added here. This is optional, however, in some cases the JSON data will contain HTML code and this can break the Javascript, causing a scripting error.
So, keep in mind that, when using this filter, any fields containing HTML code in your JSON will not actually show the HTML in the console, however, the data is still there and accessible via Liquid when rendering to the page.

Remember to remove this code for production as it could pose a data security risk and it is best practice not to leave console logs in your scripts.



System Data

BC: Page URL and URL Parameters
{module_url param="param1"} and {module_pageaddress}
eg: {
"ID": "/test2.html",
"question": "true",
}


Treepl CMS:
{{request.request_url}}
Output: {
"href": "https://docs.treepl.co/test2?question=true",
"origin": "https://docs.treepl.co",
"protocol": "https",
"hostname": "docs.treepl.co",
"path": "/test2",
"params": {
        "question": "true"
    }
}
BC: Referral Address
{module_referreraddress}
eg: "http://mysite.com/page1"

Treepl CMS:
{{request.request_data.referrer}}
 
BC: Globals and Visitor IP Address
{module_visitoripaddress} and {{globals.visitor}}
eg: "193.2.2.2"

{
"deviceClass": "desktop",
"ip": "193.2.2.2",
"country": "RO",
"userAgent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.103 Safari/537.36"
}


Treepl CMS:
{{request.request_data}}
Output: {
"ip": "193.2.2.2",
"is_mobile": 0,
"user_agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.103 Safari/537.36",
"referrer": "/page1"
}
BC: Visitor Device Class
{system_visitordeviceclass}
eg: "desktop", "phone" or "tablet"

Treepl CMS:
{{request.device_type}}
Output: "Desktop", "Tablet", "Mobile"
BC: Logged In User
{{globals.user}} and {module_isloggedin}
eg: "1" or "0"

{
"firstname": "Alex",
"lastname": "Smith",
"fullname": "Alex Smith",
"email": "asmith@example.com",
"isLoggedIn": true
}


Treepl CMS:
{{request.is_logged}} and {{request.currentmember}}
Output: "true" or "false"

{
"id": 162,
"email": "asmith@example.com",
"firstname": "Alex",
"lastname": "Smith",
"address": null,
"city": null,
"state": null,
"zipcode": null,
"country": "Australia",
"site": null,
"phone": null,
"createddatetime": "2018-11-21T15:17:22.717",
"updateddatetime": "2018-11-21T15:17:22.763",
"securezones": [
        {
            "id": 2,
            "name": "Members Secure Zone",
            "landingpageid": 2541,
            "createddatetime": "2018-11-21T15:17:23.037",
            "updateddatetime": "2018-11-21T15:17:23.037"
        }
    ]
}
"request" Documentation

View full article

This Liquid object is globally accessible in every liquid template or layout and outputs various data relating to your site.

{{ request }}

An live render of the data output is below.

{
  "request_url": {
  "href": "https://docs.treepl.co/bc-migration-guides/bc-liquid-comparisons",
  "origin": "https://docs.treepl.co",
  "protocol": "https",
  "hostname": "docs.treepl.co",
  "path": "/bc-migration-guides/bc-liquid-comparisons",
  "params": {}
},
  "cookies": {
  "asp.net_sessionid": "w025dh2jxdhy5bg2cn0a00ot"
},
  "request_data": {
  "ip": "18.207.254.88",
  "is_mobile": 0,
  "user_agent": "CCBot/2.0 (https://commoncrawl.org/faq/)",
  "referrer": null
},
  "is_logged": false,
  "currentmember": "",
  "device_type": "Desktop",
  "timezone": {
  "label": "(UTC-06:00) Central Time (US & Canada)",
  "offset": -5.0
}
}

currentmember

When a user is logged in to a secure zone, the currentmember property above will return an object with the logged in member details. An example is below:

{
    
    ...
    
    "is_logged": true,
    "currentmember": {
        "id": 162,
        "email": "asmith@example.com",
        "firstname": "Alex",
        "lastname": "Smith",
        "address": null,
        "city": null,
        "state": null,
        "zipcode": null,
        "country": "Australia",
        "site": null,
        "phone": null,
        "createddatetime": "2018-11-21T15:17:22.717",
        "updateddatetime": "2018-11-21T15:17:22.763",
        "securezones": [
            {
            "id": 2,
            "name": "Members Secure Zone",
            "landingpageid": 2541,
            "createddatetime": "2018-11-21T15:17:23.037",
            "updateddatetime": "2018-11-21T15:17:23.037"
            }
        ]
    }
}

device_type

The possible values provided by the device_type property are:

  • Desktop: when a desktop browser is rendering the page.
  • Tablet: when a tablet browser is rendering the page.
  • Mobile: when a mobile/smart phone browser is rendering the page.

A typical use case for this property is to display different content depending on the users device.

The following Liquid example will render different results on the three different device types:

{% case request.device_type %}
{% when 'Mobile' %}
    <p>I'm mobile</p>
{% when 'Tablet' %}
    <p>I'm an iPad or similar tablet.</p>
{% else %}
    <p>I must be a desktop.</p>
{% endcase %}

When using the output values in Liquid logic they are case sensitive. So, {% if request.device_type == "desktop" %}... will not work, whereas {% if request.device_type == "Desktop" %}... will work.

Accessing the Data

As an example of rendering a desired value to the page you could use the following Liquid:

{{ request.request_data.is_mobile }}

This would output the value 0 to the page based on the above example data.

By the way, the is_mobile property is a boolean indicating whether the device being used is a mobile device or not. Where 0 indicated it is not a mobile device and 1 indicated it is a mobile device.

Extending on this example, we can use this value in a conditional Liquid statement to display different content on a page for mobile devices like so:

{% if request.request_data.is_mobile == 1 %}
    <p>You're viewing mobile enabled content!</p>
{% else %}
    <p>You're viewing desktop content!</p>
{% endif %}

Viewing Data while Developing

It is often desirable to see all the data that is available to you on a page while developing your applications and there are two common techniques for doing this.

1. Rendering JSON to the Page

You can quickly and easily render the full JSON output directly to the page you are working on in order to view all the data and its structure in an easy to read format.
Simply wrap your desired Liquid object in <pre> tags like so; <pre>{{request}}</pre>

A JSON representation of the available data will be rendered to the page similar to the output examples above.

You can actually use this method to log any Liquid data to the console, such as a custom collection, for example: <pre>{{myCustomCollection}}</pre>

This of course is a temporary technique as you would not want to leave the JSON data visible on the page.

2. Rendering JSON to the Console

Perhaps a cleaner and more persistent way of viewing this data while in development, is to log the JSON output to your browser's console (in the browser's Developer Tools).

To do this, add some javascript code to your template file (just before the closing </body> tag) like this:

<script>
    console.log({{request}});
</script>

What this will do is output the JSON data into a structured data tree in your browser's Developer Tools console.

You can actually use this method to log any Liquid data to the console, such as a custom collection, for example:

<script>
    console.log({{myCustomCollection | strip_html}});
</script>

You might notice the Liquid filter | strip_html added here. This is optional, however, in some cases the JSON data will contain HTML code and this can break the Javascript, causing a scripting error.
So, keep in mind that, when using this filter, any fields containing HTML code in your JSON will not actually show the HTML in the console, however, the data is still there and accessible via Liquid when rendering to the page.

Remember to remove this code for production as it could pose a data security risk and it is best practice not to leave console logs in your scripts.

Content Modules

BC: WebApp listing module
{module_webapps render="item|collection" id="webappId|webappName" filter="item" itemId="123" targetFrame="" resultsPerPage="" hideEmptyMessage="false" rowCount="" sortType="ALPHABETICAL" collection="my_custom_collection_name" template="/folder/template.tpl"}
eg:
  • My WebApp Item 1
  • My WebApp Item 2
  • My WebApp Item 3


Treepl CMS:

Notes: No "targetFrame" or "rowCount" equivalents as no longer necessary.
Fully documented Component parameters below.
BC: Blog's Post listing module
{module_blogpostlist render="item|collection" collection="my_custom_collection_name" template="/folder/template.tpl" blogId="12345" rowCount="10" tag="tag"}
eg:
  • My Blog Post 1
  • My Blog Post 2
  • My Blog Post 3


Treepl CMS:

Notes: No "rowCount" equivalent as no longer necessary. Tag filtering can by done via teh "filterBy" parameter or via Liquid conditions in the layout or collection.
Fully documented Component parameters below.
BC: Form module
{module_webform id="1234""}
eg:
  • My Menu Item 1
  • My Menu Item 2
  • My Menu Item 3


Treepl CMS:

Fully documented Component parameters below.
Custom Module Component Documentation

View full article

This module component fetches data relating to Custom Modules.

{% component type: "module", source: "<Custom Module name/ID>", layout: "List 1" %}

Parameters and Options

Parameter Values Required Description
type module (default)
module_of_member

This is the name of the entity that needs to be used for the component retrieving function.

module is the standard retrieving function to retrieve all items.

module_of_member retrieves only those items "Added by" the currently logged in user (identified by the CreatedByMemberId property in the module items Liquid data).

The "Added by" System Property will only be available where the modules settings have "Allow Add New Items" turned on under the "Site User Permissions".

source <Module name/ID> The entity/alias name or ID that the data is to be sourced from.
layout <Your Layout name> The layout name you want to use for rendering the component. The layout name is referenced from the available Layouts of the source specified. If the parameter is blank or has an incorrect referenced Layout then the component will not render any code.
filterBy id
parentid
name
weighting
url
urlslug
releasedate
expirydate
LastUpdatedDate
Author
ItemCategories
ItemTags
<CustomPropertyName>
...and any other top level properties available for the module

The name of the property to filter by. If empty or not present, no filtering will be used.

Remove spaces from custom property names here.

filterValue <your value>
Your specific value to filter by, eg: name, id, number, date, etc.
Liquid variables can be used here also. If present but no value set, no items will be returned.
sortBy id
parentid
name
weighting
url
urlslug
releasedate
expirydate
LastUpdatedDate
Author
ItemCategories
ItemTags
<CustomPropertyName>
...and any other top level properties available for the module

The name of the property to sort by. If empty or not present, alpha/numeric sorting will be used.

Remove spaces from custom property names here.

sortOrder ASC (default)
DESC

ASC sorts the items in ascending order while DESC sorts in descending order (based on alpha/numeric or date sorting).
If empty or not present, alpha/numeric sorting will be used.
random false (default)
true

Displays the available items in a random order.

If used in conjunction with sortBy, that sorting criteria will be applied to the randomly retrieved results. So, if retrieving all, or most, of the items they will not appear to be random since they will then be sorted back into a logical order. To overcome this, set the sortBy parameter to 'enabled' (or another unused property) as this will not provide any viable sorting criteria* and the items will not be sorted from their initial random order.
* Unless there are weighted items, which will always override the random option.

limit 10 (default)
<number>

The maximum number of items returned. If displayPagination is enabled this determines the maximum number of items per page.
enablePagination true (default)
false

Enables/disables pagination for the component.

This is useful for avoiding pagniation affects for a specific component when multiple components of the same module are output on the same page and do use pagination.

displayPagination false (default)
true

Displays pagination if there are more items available than the limit set.
emptyMessage <Your custom message>
Custom content that is rendered if no items are returned by the Component. The default is no content.
Liquid variables are supported here, although Liquid logic tags and HTML are not.

If using Liquid variables with filters added, be sure to change any double quotes to single quotes. For eg:
emptyMessage: “{{ myVariable | prepend: 'Error: ' }}”

To use HTML in your empty message, first capture it using a Liquid capture, then insert the capture variable into the emptyMessage parameter.

object item (default)
collection

Determines the method for Liquid rendering.
item returns each item iteratively, one after another, for output (generally, output to a container element with no need for looping through the data).
collection returns all items as one collection for output (your container element and looping logic would be handled in the Components Layout).
collectionVariable <yourLiquidVariableName>
Assigns the data to a Liquid collection enabling further access to the data on the Page or Template using Liquid.

Your collectionVariable value must only contain English letters, numbers or underscores. Spaces or special characters are not supported.

isSearchResult false (default)
true

Allows search parameters in the URL to override the components output. Therefore, this parameter can be used to output module specific search results from a submitted search form.

Likewise, Tag, Category, and Archive components can be used in conjunction with this parameter for filtering the module's output.

URL search parameters will override any corresponding parameters in the component. If no search parameters are present in the URL, isSearchResult will be ignored.

Any value other than true, (including an empty value), will disable the search functionality and the component will output its regular data.

searchScope eg:
{'prop_ParentId':'1234', 'prop_ReleaseDate_Min':'2018-07-01', 'prop_ReleaseDate_Max':'2018-07-31', 'prop_KeyWords':'Your Keywords', 'prop_ItemTags':['tag1','tag2'], 'page':'2'}

Allows a search on the module without search parameters needed in the URL. Instead, search parameters are added to the value of this parameter. Therefore, this parameter can be used to output module specific search results from hard-coded (or Liquid) values without the use of a search form.

Added search parameters will override any corresponding parameters otherwise configured on the component. If no search parameters are present, searchScope will be ignored.

This value supports Liquid and can therefore be constructed with Liquid data/variables.

<customParameter> <your custom value>
You can add your own additional parameters (name/value pairs) to the Component tag. These will be passed to the Components Layout (and the collectionVariable if used) for use via Liquid.

Your <customParameter> name must only contain English letters, numbers or underscores. Spaces or special characters are not supported.

You can use HTML as the value here, just be sure to change any double quotes in your HTML to single quotes.

Liquid Output

The below example has 4 sample items but is otherwise the default data you will get from this Component.

For Custom Modules this data will also include any custom properties/fields that you've added.

{
  "Pagination": {
  "CurrentPage": 1,
  "ItemsPerPage": 10,
  "NumberOfPages": 1,
  "TotalItemsCount": 4
},
  "Items": [
  {
    "Id": 2262,
    "Url": "/demo-web-technologies/css",
    "ParentId": 2258,
    "LastUpdatedDate": "2019-03-03T16:54:30",
    "Name": "CSS",
    "UrlSlug": "css",
    "Enabled": true,
    "ReleaseDate": "2018-11-24T16:54:29.7399709",
    "ExpiryDate": "2099-12-10T16:54:29.7399709",
    "Weighting": 0,
    "Description": "<p>CSS (Cascading Style Sheets) is used to describe presentation semantics i.e. how a document looks and feels.</p><p>It can be embedded directly inside tags (by using the <em>style</em> attribute) or inserted in the document head by using the&nbsp;<em>style</em>&nbsp;tag.</p><ul><div dir=\"ltr\"><br></div></ul>",
    "ItemTags": null,
    "Author_Name": null,
    "Author_Url": null,
    "Author": "",
    "SEOTitle": "",
    "MetaTitle": "",
    "MetaDescription": "",
    "ShowPageForSearchEngine": true,
    "CanonicalLink": "",
    "EnableAMP": false,
    "AMPContent": "",
    "CodeEditor": true,
    "ExternalId": 0,
    "SocialMetaTags": "",
    "OpenGraphProperties": "",
    "DisableForSiteSearch": false,
    "SeoPriority": "",
    "CreatedByMemberId": 0,
    "ItemCategories": null,
    "ItemCategoryIdList": null,
    "SKUCode": "",
    "SiteSearchKeywords": "",
    "MyCustomProperty1": "foobar",
    "MyCustomProperty2": "",
    "CustomDatasourceProperty_Name": "Null type",
    "CustomDatasourceProperty_Url": "/demo-web-technologies/javascript/null-type",
    "CustomDatasourceProperty": 2267
  },
  {
    "Id": 2263,
    "Url": "/demo-web-technologies/html",
    "ParentId": 2258,
    "LastUpdatedDate": "2019-02-28T20:44:56",
    "Name": "HTML",
    "UrlSlug": "html",
    "Enabled": true,
    "ReleaseDate": "2018-11-24T18:00:00",
    "ExpiryDate": "2099-12-10T18:00:00",
    "Weighting": 0,
    "Description": "<p>The&nbsp;<strong>Hyper Text Markup Language</strong>&nbsp;(HTML) is mainly used for writing web pages. It is XML based and allows users to create structured text documents (by using tags and attributes) and insert text semantics (paragraphs, headers, tables, etc.).</p>\r\n\r\n<p>Usually it is used in conjuncture with&nbsp;<strong>JavaScript</strong>&nbsp;- which influences the behaviour of browsers - and&nbsp;<strong>CSS (Cascading Style Sheets)</strong>&nbsp;- for formating text and overall page appearance.</p>\r\n\r\n<p>Latest standard release by W3C was that of HTML 5.0 (ISO/IEC 15445:2000) in October 2014.</p>\r\n\r\n<p>In 2008 a draft for an HTML 5 was released. It includes several modifications:</p>\r\n\r\n<ul>\r\n<li>obsolete tags such as&nbsp;<em>font</em>,&nbsp;<em>frameset</em>&nbsp;or&nbsp;<em>center</em>&nbsp;were removed</li>\r\n<li>new tags such as&nbsp;<em>footer</em>,&nbsp;<em>audio</em>,&nbsp;<em>video</em>,&nbsp;<em>nav</em>, etc.</li>\r\n<li>new attributes such as&nbsp;<em>ping</em>,&nbsp;<em>async</em>, etc.</li>\r\n<li>new parsing mechanism</li>\r\n<li>ability to use SVG and MathML in text/html</li>\r\n<li>etc.</li>\r\n</ul>\r\n\r\n<p>Related languages include the&nbsp;<strong>XHTML</strong>&nbsp;1.1 which is an extension of HTML based on XML and not SGML.</p>\r\n\r\n<p>Three sub-specifications exist for both HTML and XHTML:</p>\r\n\r\n<ul>\r\n<li><strong>Strict</strong>: represents the standard proper and encourages the omission of presentational markup (eg. center or font tags) by using style sheets (CSS)</li>\r\n<li><strong>Transitional</strong>: allows for presentational markup</li>\r\n<li><strong>Frameset</strong>: allows for presentational markup and additionally from&nbsp;<em>Transitional</em>&nbsp;a frameset replacing body, containing frame elements, and optionally noframes, with a body</li>\r\n</ul>\r\n\r\n<p>Each document is checked against a DTD (Document Type Definition) file for validity.</p>",
    "ItemTags": null,
    "Author_Name": null,
    "Author_Url": null,
    "Author": "",
    "SEOTitle": "",
    "MetaTitle": "",
    "MetaDescription": "",
    "ShowPageForSearchEngine": true,
    "CanonicalLink": "",
    "EnableAMP": false,
    "AMPContent": "",
    "CodeEditor": true,
    "ExternalId": 0,
    "SocialMetaTags": "",
    "OpenGraphProperties": "",
    "DisableForSiteSearch": false,
    "SeoPriority": "",
    "CreatedByMemberId": 0,
    "ItemCategories": null,
    "ItemCategoryIdList": null,
    "SKUCode": "",
    "SiteSearchKeywords": "",
    "MyCustomProperty1": "sampledata",
    "MyCustomProperty2": "",
    "CustomDatasourceProperty_Name": null,
    "CustomDatasourceProperty_Url": null,
    "CustomDatasourceProperty": ""
  },
  {
    "Id": 2264,
    "Url": "/demo-web-technologies/javascript",
    "ParentId": 2258,
    "LastUpdatedDate": "2019-02-28T20:44:56",
    "Name": "Javascript",
    "UrlSlug": "javascript",
    "Enabled": true,
    "ReleaseDate": "2018-11-24T18:00:00",
    "ExpiryDate": "2099-12-10T18:00:00",
    "Weighting": 0,
    "Description": "<p><strong>JavaScript</strong>&nbsp;(JS) is the name of Netscape Communications Corporation's and now the Mozilla’s foundation implementation of the&nbsp;<em>ECMAScript</em>&nbsp;standard, a scripting language based on the concept of prototype based programming.</p><p>The language is best known for its use in websites (as client side JavaScript), but is also used to enable scripting access to objects embedded in other applications.</p><p><strong>IMPORTANT</strong>: JavaScript is not Java!</p><p>JS can be used to do various things but it primarily comes into hand when:</p><ul><li>doing browser detection</li><li>handling cookies</li><li>controlling browsers</li><li>validating forms</li><li>setting CSS properties dynamically (see&nbsp;<a href=\"http://www.comptechdoc.org/independent/web/cgi/javamanual/javastyle.html\" rel=\"nofollow\">http://www.comptechdoc.org/independent/web/cgi/javamanual/javastyle.html</a>), eg.&nbsp;<em>element.style.border=\"1px solid black\"</em></li></ul>",
    "ItemTags": null,
    "Author_Name": null,
    "Author_Url": null,
    "Author": "",
    "SEOTitle": "",
    "MetaTitle": "",
    "MetaDescription": "",
    "ShowPageForSearchEngine": true,
    "CanonicalLink": "",
    "EnableAMP": false,
    "AMPContent": "",
    "CodeEditor": true,
    "ExternalId": 0,
    "SocialMetaTags": "",
    "OpenGraphProperties": "",
    "DisableForSiteSearch": false,
    "SeoPriority": "",
    "CreatedByMemberId": 0,
    "ItemCategories": null,
    "ItemCategoryIdList": null,
    "SKUCode": "",
    "SiteSearchKeywords": "",
    "MyCustomProperty1": "",
    "MyCustomProperty2": "",
    "CustomDatasourceProperty_Name": null,
    "CustomDatasourceProperty_Url": null,
    "CustomDatasourceProperty": ""
  },
  {
    "Id": 2265,
    "Url": "/demo-web-technologies/liquid",
    "ParentId": 2258,
    "LastUpdatedDate": "2019-02-28T20:44:57",
    "Name": "Liquid",
    "UrlSlug": "liquid",
    "Enabled": true,
    "ReleaseDate": "2018-11-24T18:00:00",
    "ExpiryDate": "2099-12-10T18:00:00",
    "Weighting": 0,
    "Description": "<p>Liquid is an open-source template language created by&nbsp;Shopify&nbsp;and written in Ruby. It is the backbone of Shopify themes and is used to load dynamic content on storefronts.</p><p>Liquid has been in production use at Shopify since 2006 and is now used by many other hosted web applications.</p>",
    "ItemTags": null,
    "Author_Name": null,
    "Author_Url": null,
    "Author": "",
    "SEOTitle": "",
    "MetaTitle": "",
    "MetaDescription": "",
    "ShowPageForSearchEngine": true,
    "CanonicalLink": "",
    "EnableAMP": false,
    "AMPContent": "",
    "CodeEditor": true,
    "ExternalId": 0,
    "SocialMetaTags": "",
    "OpenGraphProperties": "",
    "DisableForSiteSearch": false,
    "SeoPriority": "",
    "CreatedByMemberId": 0,
    "ItemCategories": null,
    "ItemCategoryIdList": null,
    "SKUCode": "",
    "SiteSearchKeywords": "",
    "MyCustomProperty1": "",
    "MyCustomProperty2": "",
    "CustomDatasourceProperty_Name": null,
    "CustomDatasourceProperty_Url": null,
    "CustomDatasourceProperty": ""
  }
],
  "Params": {},
  "Parent": {
  "Id": 1960,
  "Url": "/component-types/module-custom-modules",
  "ParentId": 2127,
  "LastUpdatedDate": "2020-05-20T00:45:22",
  "Name": "module (Custom Modules)",
  "UrlSlug": "module-custom-modules",
  "Enabled": true,
  "ReleaseDate": "2018-06-19T00:00:00",
  "ExpiryDate": "2099-10-10T00:00:00",
  "Weighting": 930,
  "Description": "<p>This module component fetches data relating to Custom Modules.</p>\n\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{data}}\", lang: \"liquid\" %}\n\n\n{% component type: \"snippet\", alias: \"section_parameters\" %}\n\n{% component type: \"snippet\", alias: \"param_table_head\" %}\n    {% component type: \"snippet\", alias: \"param_type\", required: \"true\", values: \"module <em>(default)</em>,module_of_member\" %}\n    {% component type: \"snippet\", alias: \"param_source\", required: \"true\" %}\n    {% component type: \"snippet\", alias: \"param_layout\", required: \"true\" %}\n    {% component type: \"snippet\", alias: \"param_filterby\" %}\n    {% component type: \"snippet\", alias: \"param_filtervalue\" %}\n    {% component type: \"snippet\", alias: \"param_sortby\" %}\n    {% component type: \"snippet\", alias: \"param_sortorder\" %}\n    {% component type: \"snippet\", alias: \"param_random\" %}\n    {% component type: \"snippet\", alias: \"param_limit\" %}\n    {% component type: \"snippet\", alias: \"param_enablepagination\" %}\n    {% component type: \"snippet\", alias: \"param_displaypagination\" %}\n    {% component type: \"snippet\", alias: \"param_emptymessage\" %}\n    {% component type: \"snippet\", alias: \"param_object\" %}\n    {% component type: \"snippet\", alias: \"param_collectionvariable\" %}\n    {% component type: \"snippet\", alias: \"param_issearchresult\" %}\n    {% component type: \"snippet\", alias: \"param_searchscope\" %}\n    {% component type: \"snippet\", alias: \"param_customparameter\" %}\n{% component type: \"snippet\", alias: \"param_table_foot\" %}\n\n\n{% component type: \"snippet\", alias: \"section_output\" %}\n\n<p>The below example has 4 sample <code>items</code> but is otherwise the default data you will get from this Component.</p>\n\n<p>For Custom Modules this data will also include any custom properties/fields that you've added.</p>\n\n{% component source: \"DEMO Web Technologies\", layout: "", collectionVariable: \"webTech\", type: \"module\" %}\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{webTech}}\", lang: \"json\" %}\n\n{% component type: \"snippet\", alias: \"section_accessing_data\" %}\n\n<p>This data is accessible in two main ways:</p>\n\n<p>1. Using Liquid in the specified Layout via the <code>this</code> object.</p>\n\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{data}}\", lang: \"liquid\" %}\n\n<p>2. Directly on the Page or Template via a Liquid Collection if <code>collectionVariable</code> was added to the Component tag.</p>\n\n<p>An example using <code>collectionVariable</code> with value \"webTech\" for a Custom Module called \"Web Technologies\":</p>\n\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{data}}\", lang: \"liquid\" %}\n\n<p><em>Looping through the collection to render all the item URLs in a list, giving us:</em></p>\n\n<ul>\n    \n        <li>/demo-web-technologies/css</li>\n    \n        <li>/demo-web-technologies/html</li>\n    \n        <li>/demo-web-technologies/javascript</li>\n    \n        <li>/demo-web-technologies/liquid</li>\n    \n</ul>\n<br>\n<p><em>The code:</em></p>\n\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{data}}\", lang: \"liquid\" %}\n\n<p><em>Accessing a specific item within the collection. In this case the third item (zero based index), which in our example would render the value <code>/web-technologies/javascript/</code></em></p>\n\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{data}}\", lang: \"liquid\" %}\n\n\n{% component type: \"snippet\", alias: \"section_counter\" %}\n",
  "ItemTags": [
  "Custom Modules"
],
  "Author_Name": "",
  "Author_Url": "",
  "Author": "",
  "SEOTitle": "Component Type: Module (Custom Modules)",
  "MetaTitle": "Component Type: Module (Custom Modules)",
  "MetaDescription": "",
  "ShowPageForSearchEngine": true,
  "CanonicalLink": "",
  "EnableAMP": false,
  "AMPContent": "",
  "CodeEditor": true,
  "ExternalId": 0,
  "SocialMetaTags": "",
  "OpenGraphProperties": "",
  "DisableForSiteSearch": false,
  "SeoPriority": "",
  "CreatedByMemberId": 0,
  "ItemCategories": "",
  "ItemCategoryIdList": "",
  "SKUCode": "",
  "SiteSearchKeywords": "",
  "Active": true,
  "IgnoreUpdates": false,
  "UpdateNotes": "'module_of_member' parameter details added.",
  "ExternalResources": "",
  "AdditionalRelatedArticle_Name": "",
  "AdditionalRelatedArticle_Url": "",
  "AdditionalRelatedArticle": "",
  "AdditionalRelatedArticle2_Name": "",
  "AdditionalRelatedArticle2_Url": "",
  "AdditionalRelatedArticle2": "",
  "Authors": "2418",
  "Pagination": {
  "CurrentPage": 1,
  "ItemsPerPage": 1,
  "NumberOfPages": 1,
  "TotalItemsCount": 1
},
  "Params": {},
  "Parent": {
  "Id": 2361,
  "Url": "/bc-migration-guides/bc-liquid-comparisons",
  "ParentId": 2355,
  "LastUpdatedDate": "2020-04-29T19:51:07",
  "Name": "BC Liquid Comparisons",
  "UrlSlug": "bc-liquid-comparisons",
  "Enabled": true,
  "ReleaseDate": "2019-02-28T00:00:00",
  "ExpiryDate": "2099-12-11T00:00:00",
  "Weighting": 700,
  "Description": "<p>Below are some typical BC Liquid and tags you may be using and their closest Treepl CMS comparisons.</p>\n\n  \n  <table style=\"width: 100%;\">\n    <thead>\n        <tr>\n            <th><h2 id=\"secItem\">Item Data</h2></th>\n        </tr>\n    </thead>\n    <tbody>      \n        \n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Page Name</b><br><code>{module_pagename}</code><br><small>eg: \"About\"</small>\n            <br class=\"space\"><br class=\"space\">\n            <b>Treepl CMS:</b><br><code>&#123;&#123;this.name&#125;&#125;</code><br><small>Name of current item (within the context/scope of the template/layout where it is placed)</small></td>\n        </tr>\n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Page Title</b><br><code>{module_pagetitle}</code><br><small>eg: \"About ABC Company\"</small>\n            <br class=\"space\"><br class=\"space\">\n            <b>Treepl CMS:</b><br><code>&#123;&#123;this.seotitle&#125;&#125;</code><br><small>Meta title of current item (within the context/scope of the template/layout where it is placed)</small></td>\n        </tr>\n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Page ID</b><br><code>{module_oid}</code><br><small>eg: \"12345\"</small>\n            <br class=\"space\"><br class=\"space\">\n            <b>Treepl CMS:</b><br><code>&#123;&#123;this.id&#125;&#125;</code><br><small>ID of current item (within the context/scope of the template/layout where it is placed)</small></td>\n        </tr>\n </tbody>\n</table>\n        <div class=\"tab-content faqsOpenCloseHolder\">\n    <div class=\"faqs-open-close \">\n        <a class=\"opener\" href=\"#\"><i class=\"fas fa-angle-right\"></i>\"this\" Documentation</a>\n        <div class=\"slide js-slide-hidden\">\n  {% component source: \"Documentation Post\", layout: \"Body Detail\", filterBy: \"id\", filterValue: \"2324\", limit: \"1\", type: \"module\" %}\n  </div>\n    </div>\n    </div>\n  <p><br><br></p>       \n        \n        \n        \n  \n  \n  \n  \n<table style=\"width: 100%;\">\n    <thead>\n        <tr>\n            <th><h2 id=\"secSystem\">System Data</h2></th>\n        </tr>\n    </thead>\n    <tbody>        \n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Page URL and URL Parameters</b><br><code>{module_url param=\"param1\"} and {module_pageaddress}</code><br><small>eg: {<br>\n  \"ID\": \"/test2.html\",<br>\n  \"question\": \"true\",<br>\n}</small>\n<br class=\"space\"><br class=\"space\">\n<b>Treepl CMS:</b><br><code>&#123;&#123;request.request_url&#125;&#125;</code><br><small>Output: {<br>\n    \"href\": \"https://docs.treepl.co/test2?question=true\",<br>\n    \"origin\": \"https://docs.treepl.co\",<br>\n    \"protocol\": \"https\",<br>\n    \"hostname\": \"docs.treepl.co\",<br>\n    \"path\": \"/test2\",<br>\n    \"params\": {<br>\n      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"question\": \"true\"<br>\n    &nbsp;&nbsp;&nbsp;&nbsp;}<br>\n    }</small></td>\n        </tr>\n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Referral Address</b><br><code>{module_referreraddress}</code><br><small>eg: \"http://mysite.com/page1\"</small>\n            <br class=\"space\"><br class=\"space\">\n            <b>Treepl CMS:</b><br><code>&#123;&#123;request.request_data.referrer&#125;&#125;</code><br><small>&nbsp;</small></td>\n        </tr>\n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Globals and Visitor IP Address</b><br><code>{module_visitoripaddress} and &#123;&#123;globals.visitor&#125;&#125;</code><br><small>eg: \"193.2.2.2\"<br><br>{<br>\n  \"deviceClass\": \"desktop\",<br>\n  \"ip\": \"193.2.2.2\",<br>\n  \"country\": \"RO\",<br>\n  \"userAgent\": \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.103 Safari/537.36\"<br>\n}</small>\n<br class=\"space\"><br class=\"space\">\n<b>Treepl CMS:</b><br><code>&#123;&#123;request.request_data&#125;&#125;</code><br><small>Output: {<br>\n    \"ip\": \"193.2.2.2\",<br>\n    \"is_mobile\": 0,<br>\n    \"user_agent\": \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.103 Safari/537.36\",<br>\n    \"referrer\": \"/page1\"<br>\n  }</small></td>\n        </tr>\n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Visitor Device Class</b><br><code>{system_visitordeviceclass}</code><br><small>eg: \"desktop\", \"phone\" or \"tablet\"</small>\n            <br class=\"space\"><br class=\"space\">\n            <b>Treepl CMS:</b><br><code>&#123;&#123;request.device_type&#125;&#125;</code><br><small>Output: \"Desktop\", \"Tablet\", \"Mobile\"</small></td>\n        </tr>\n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Logged In User</b><br><code>&#123;&#123;globals.user&#125;&#125; and {module_isloggedin}</code><br><small>eg: \"1\" or \"0\"<br><br>{<br>\n  \"firstname\": \"Alex\",<br>\n  \"lastname\": \"Smith\",<br>\n  \"fullname\": \"Alex Smith\",<br>\n  \"email\": \"asmith@example.com\",<br>\n  \"isLoggedIn\": true<br>\n}</small>\n<br class=\"space\"><br class=\"space\">\n<b>Treepl CMS:</b><br><code>&#123;&#123;request.is_logged&#125;&#125; and &#123;&#123;request.currentmember&#125;&#125;</code><br><small>Output: \"true\" or \"false\"<br><br>{<br>\n        \"id\": 162,<br>\n        \"email\": \"asmith@example.com\",<br>\n        \"firstname\": \"Alex\",<br>\n        \"lastname\": \"Smith\",<br>\n        \"address\": null,<br>\n        \"city\": null,<br>\n        \"state\": null,<br>\n        \"zipcode\": null,<br>\n        \"country\": \"Australia\",<br>\n        \"site\": null,<br>\n        \"phone\": null,<br>\n        \"createddatetime\": \"2018-11-21T15:17:22.717\",<br>\n        \"updateddatetime\": \"2018-11-21T15:17:22.763\",<br>\n        \"securezones\": [<br>\n            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>\n            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"id\": 2,<br>\n            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"name\": \"Members Secure Zone\",<br>\n            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"landingpageid\": 2541,<br>\n            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"createddatetime\": \"2018-11-21T15:17:23.037\",<br>\n            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"updateddatetime\": \"2018-11-21T15:17:23.037\"<br>\n            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>\n        &nbsp;&nbsp;&nbsp;&nbsp;]<br>\n    }</small></td>\n        </tr>\n         </tbody>\n</table>\n        <div class=\"tab-content faqsOpenCloseHolder\">\n    <div class=\"faqs-open-close \">\n        <a class=\"opener\" href=\"#\"><i class=\"fas fa-angle-right\"></i>\"request\" Documentation</a>\n        <div class=\"slide js-slide-hidden\">\n  {% component source: \"Documentation Post\", layout: \"Body Detail\", filterBy: \"id\", filterValue: \"1964\", limit: \"1\", type: \"module\" %}\n  </div>\n    </div>\n    </div>\n\n     \n     \n     \n     \n     \n        \n<table style=\"width: 100%;\">\n    <thead>\n        <tr>\n            <th><h2 id=\"secContent\">Content Modules</h2></th>\n        </tr>\n    </thead>\n    <tbody>      \n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: WebApp listing module</b><br><code>{module_webapps render=\"item|collection\" id=\"webappId|webappName\" filter=\"item\" itemId=\"123\" targetFrame=\"\" resultsPerPage=\"\" hideEmptyMessage=\"false\" rowCount=\"\" sortType=\"ALPHABETICAL\" collection=\"my_custom_collection_name\" template=\"/folder/template.tpl\"}</code><br><small>eg: <ul>\n    <li>My WebApp Item 1</li>\n    <li>My WebApp Item 2</li>\n    <li>My WebApp Item 3</li>\n</ul></small>\n<br class=\"space\"><br class=\"space\">\n<b>Treepl CMS:</b><br><code>{% component type: \"module\", object: \"item|collection\", source: \"&lt;Custom Module name/ID&gt;\", filterBy: \"id\", filterValue: \"123\", limit: \"10\", emptyMessage: \"&lt;your content&gt;\", sortBy: \"name\", collectionVariable: \"my_custom_collection_name\", layout: \"List 1\" %}</code><br><small>Notes: No \"targetFrame\" or \"rowCount\" equivalents as no longer necessary.<br>Fully documented Component parameters below.</small></td>\n        </tr>\n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Blog's Post listing module</b><br><code>{module_blogpostlist render=\"item|collection\" collection=\"my_custom_collection_name\" template=\"/folder/template.tpl\" blogId=\"12345\" rowCount=\"10\" tag=\"tag\"}</code><br><small>eg: <ul>\n    <li>My Blog Post 1</li>\n    <li>My Blog Post 2</li>\n    <li>My Blog Post 3</li>\n</ul></small>\n<br class=\"space\"><br class=\"space\">\n<b>Treepl CMS:</b><br><code>{% component type: \"module\", object: \"item|collection\", collectionVariable: \"my_custom_collection_name\", layout: \"List\", filterBy: \"parentid\", filterValue: \"12345\", source: \"Blog Post\" %}</code><br><small>Notes: No \"rowCount\" equivalent as no longer necessary. Tag filtering can by done via teh \"filterBy\" parameter or via Liquid conditions in the layout or collection.<br>Fully documented Component parameters below.</small></td>\n        </tr>\n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Form module</b><br><code>{module_webform id=\"1234\"\"}</code><br><small>eg: <ul>\n    <li>My Menu Item 1</li>\n    <li>My Menu Item 2</li>\n    <li>My Menu Item 3</li>\n</ul></small>\n<br class=\"space\"><br class=\"space\">\n<b>Treepl CMS:</b><br><code>{% component type: \"menu\", alias: \"&lt;menu_alias&gt;\" %}</code><br><small>Fully documented Component parameters below.</small></td>\n        </tr>\n </tbody>\n</table>       \n    \n   \n   <div class=\"tab-content faqsOpenCloseHolder\">\n    <div class=\"faqs-open-close \">\n        <a class=\"opener\" href=\"#\"><i class=\"fas fa-angle-right\"></i>Custom Module Component Documentation</a>\n        <div class=\"slide js-slide-hidden\">\n   {% component source: \"Documentation Post\", layout: \"Body Detail\", filterBy: \"id\", filterValue: \"1960\", limit: \"1\", type: \"module\" %}\n   </div>\n    </div>\n    </div>\n   \n   <div class=\"tab-content faqsOpenCloseHolder\">\n    <div class=\"faqs-open-close \">\n        <a class=\"opener\" href=\"#\"><i class=\"fas fa-angle-right\"></i>Blog Post Component Documentation</a>\n        <div class=\"slide js-slide-hidden\">\n   {% component source: \"Documentation Post\", layout: \"Body Detail\", filterBy: \"id\", filterValue: \"2142\", limit: \"1\", type: \"module\" %}\n   </div>\n    </div>\n    </div>\n   \n   \n   <div class=\"tab-content faqsOpenCloseHolder\">\n    <div class=\"faqs-open-close \">\n        <a class=\"opener\" href=\"#\"><i class=\"fas fa-angle-right\"></i>Menu Component Documentation</a>\n        <div class=\"slide js-slide-hidden\">\n   {% component source: \"Documentation Post\", layout: \"Body Detail\", filterBy: \"id\", filterValue: \"1958\", limit: \"1\", type: \"module\" %}\n   </div>\n    </div>\n    </div>\n  <p><br><br></p>      \n        \n        \n        \n        \n\n\n\n<table style=\"width: 100%;\">\n    <thead>\n        <tr>\n            <th><h2 id=\"secSyntax\">Dates, Filters &amp; General Syntax</h2></th>\n        </tr>\n    </thead>\n    <tbody>\n        \n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Current Date (from server)</b><br><code>&#123;&#123; globals.site.dateNow | datetime &#125;&#125;</code><br><small>eg: \"09-Jan-2015 02:46 PM\"</small>\n            <br class=\"space\"><br class=\"space\">\n            <b>Treepl CMS:</b><br><code>&#123;&#123; \"now\" | date: \"%d-%b-%Y %I:%M %p\"  &#125;&#125;</code><br><small>Date formatting examples in the Liquid documentation <a href=\"https://shopify.github.io/liquid/filters/date/\" target=\"_blank\">here</a>, a very useful tool for generating date formats can be found at <a href=\"http://strftime.net/\" target=\"_blank\">STRFTIME.net</a></small></td>\n        </tr>\n  </tbody>\n</table>      \n        <div class=\"tab-content faqsOpenCloseHolder\">\n    <div class=\"faqs-open-close \">\n        <a class=\"opener\" href=\"#\"><i class=\"fas fa-angle-right\"></i>Liquid Syntax Documentation</a>\n        <div class=\"slide js-slide-hidden\">\n    {% component source: \"Documentation Post\", layout: \"Body Detail\", filterBy: \"id\", filterValue: \"2128\", limit: \"1\", type: \"module\" %}\n    </div>\n    </div>\n    </div>\n  <p><br><br></p>\n  \n   ",
  "ItemTags": [
  "Migrations"
],
  "Author_Name": "",
  "Author_Url": "",
  "Author": "",
  "SEOTitle": "",
  "MetaTitle": "",
  "MetaDescription": "",
  "ShowPageForSearchEngine": true,
  "CanonicalLink": "",
  "EnableAMP": false,
  "AMPContent": "",
  "CodeEditor": true,
  "ExternalId": 0,
  "SocialMetaTags": "",
  "OpenGraphProperties": "",
  "DisableForSiteSearch": false,
  "SeoPriority": "",
  "CreatedByMemberId": 0,
  "ItemCategories": "",
  "ItemCategoryIdList": "",
  "SKUCode": "",
  "SiteSearchKeywords": "",
  "Active": true,
  "IgnoreUpdates": true,
  "UpdateNotes": "Added external resource link for BC to Treepl App conversion info.",
  "ExternalResources": "<ul><li><a href=\"https://forum.treepl.co/t/bc-to-treepl-app-updates-announcements-and-discussions/497\" rel=\"noopener noreferrer\" target=\"_blank\" title=\"\">BC to Treepl CMS App - Liquid and Tag Conversions</a></li></ul>",
  "AdditionalRelatedArticle_Name": "",
  "AdditionalRelatedArticle_Url": "",
  "AdditionalRelatedArticle": "",
  "AdditionalRelatedArticle2_Name": "",
  "AdditionalRelatedArticle2_Url": "",
  "AdditionalRelatedArticle2": "",
  "Authors": "2418",
  "ParentName": "BC Migration Guides",
  "ParentUrl": "/bc-migration-guides",
  "TemplateName": "Docs Template",
  "IsHome": false
}
}
}

Accessing the Data

This data is accessible in two main ways:

1. Using Liquid in the specified Layout via the this object.

{{this['url']}}

2. Directly on the Page or Template via a Liquid Collection if collectionVariable was added to the Component tag.

An example using collectionVariable with value "webTech" for a Custom Module called "Web Technologies":

{% component type: "module", source: "Web Technologies", layout: "List 1", collectionVariable: "webTech" %}

Looping through the collection to render all the item URLs in a list, giving us:

  • /demo-web-technologies/css
  • /demo-web-technologies/html
  • /demo-web-technologies/javascript
  • /demo-web-technologies/liquid

The code:

<ul>
    {% for i in webTech.items %}
        <li>{{i['url']}}</li>
    {% endfor %}
</ul>

Accessing a specific item within the collection. In this case the third item (zero based index), which in our example would render the value /web-technologies/javascript/

{{webTech.items[2]['url']}}

Counter

Along with the data output above, there is also a special liquid tag available {{counter}} which increments for each item. This tag is only available within Layouts when object: "item" is used in the Component tag.

Blog Post Component Documentation

View full article

This module component fetches data relating to Blog Posts.

{% component type: "module", source: "Blog Post", layout: "List" %}

Parameters and Options

Parameter Values Required Description
type module (default)
module_of_member

This is the name of the entity that needs to be used for the component retrieving function.

module is the standard retrieving function to retrieve all items.

module_of_member retrieves only those items "Added by" the currently logged in user (identified by the CreatedByMemberId property in the module items Liquid data).

The "Added by" System Property will only be available where the modules settings have "Allow Add New Items" turned on under the "Site User Permissions".

source Blog Post (default) The entity/alias name or ID that the data is to be sourced from.
layout List (default)
<Your Layout name>
The layout name you want to use for rendering the component. The layout name is referenced from the available Layouts of the source specified. If the parameter is blank or has an incorrect referenced Layout then the component will not render any code.
filterBy id
parentid
name
weighting
url
urlslug
releasedate
expirydate
LastUpdatedDate
Author
ItemCategories
ItemTags
<CustomPropertyName>
...and any other top level properties available for the module

The name of the property to filter by. If empty or not present, no filtering will be used.

Remove spaces from custom property names here.

filterValue <your value>
Your specific value to filter by, eg: name, id, number, date, etc.
Liquid variables can be used here also. If present but no value set, no items will be returned.
sortBy id
parentid
name
weighting
url
urlslug
releasedate
expirydate
LastUpdatedDate
Author
ItemCategories
ItemTags
<CustomPropertyName>
...and any other top level properties available for the module

The name of the property to sort by. If empty or not present, alpha/numeric sorting will be used.

Remove spaces from custom property names here.

sortOrder ASC (default)
DESC

ASC sorts the items in ascending order while DESC sorts in descending order (based on alpha/numeric or date sorting).
If empty or not present, alpha/numeric sorting will be used.
random false (default)
true

Displays the available items in a random order.

If used in conjunction with sortBy, that sorting criteria will be applied to the randomly retrieved results. So, if retrieving all, or most, of the items they will not appear to be random since they will then be sorted back into a logical order. To overcome this, set the sortBy parameter to 'enabled' (or another unused property) as this will not provide any viable sorting criteria* and the items will not be sorted from their initial random order.
* Unless there are weighted items, which will always override the random option.

limit 10 (default)
<number>

The maximum number of items returned. If displayPagination is enabled this determines the maximum number of items per page.
displayPagination false (default)
true

Displays pagination if there are more items available than the limit set.
emptyMessage <Your custom message>
Custom content that is rendered if no items are returned by the Component. The default is no content.
Liquid variables are supported here, although Liquid logic tags and HTML are not.

If using Liquid variables with filters added, be sure to change any double quotes to single quotes. For eg:
emptyMessage: “{{ myVariable | prepend: 'Error: ' }}”

To use HTML in your empty message, first capture it using a Liquid capture, then insert the capture variable into the emptyMessage parameter.

object item (default)
collection

Determines the method for Liquid rendering.
item returns each item iteratively, one after another, for output (generally, output to a container element with no need for looping through the data).
collection returns all items as one collection for output (your container element and looping logic would be handled in the Components Layout).
collectionVariable <yourLiquidVariableName>
Assigns the data to a Liquid collection enabling further access to the data on the Page or Template using Liquid.

Your collectionVariable value must only contain English letters, numbers or underscores. Spaces or special characters are not supported.

isSearchResult false (default)
true

Allows search parameters in the URL to override the components output. Therefore, this parameter can be used to output module specific search results from a submitted search form.

Likewise, Tag, Category, and Archive components can be used in conjunction with this parameter for filtering the module's output.

URL search parameters will override any corresponding parameters in the component. If no search parameters are present in the URL, isSearchResult will be ignored.

Any value other than true, (including an empty value), will disable the search functionality and the component will output its regular data.

searchScope eg:
{'prop_ParentId':'1234', 'prop_ReleaseDate_Min':'2018-07-01', 'prop_ReleaseDate_Max':'2018-07-31', 'prop_KeyWords':'Your Keywords', 'prop_ItemTags':['tag1','tag2'], 'page':'2'}

Allows a search on the module without search parameters needed in the URL. Instead, search parameters are added to the value of this parameter. Therefore, this parameter can be used to output module specific search results from hard-coded (or Liquid) values without the use of a search form.

Added search parameters will override any corresponding parameters otherwise configured on the component. If no search parameters are present, searchScope will be ignored.

This value supports Liquid and can therefore be constructed with Liquid data/variables.

<customParameter> <your custom value>
You can add your own additional parameters (name/value pairs) to the Component tag. These will be passed to the Components Layout (and the collectionVariable if used) for use via Liquid.

Your <customParameter> name must only contain English letters, numbers or underscores. Spaces or special characters are not supported.

You can use HTML as the value here, just be sure to change any double quotes in your HTML to single quotes.

Liquid Output

The below example has 3 sample items but is otherwise the default structure you will get from this Component.

{
  "Pagination": {
  "CurrentPage": 1,
  "ItemsPerPage": 3,
  "NumberOfPages": 3,
  "TotalItemsCount": 7
},
  "Items": [
  {
    "Id": 2280,
    "Url": "/demo-html-blog/demo-html-post",
    "ParentId": 2279,
    "LastUpdatedDate": "2019-02-28T20:44:52",
    "Name": "DEMO HTML Post",
    "UrlSlug": "demo-html-post",
    "Enabled": true,
    "ReleaseDate": "2018-11-25T16:55:52.8064367",
    "ExpiryDate": "2099-12-10T16:55:52.8064367",
    "Weighting": 0,
    "Description": "<p>Orci phasellus egestas tellus rutrum tellus pellentesque. Sed enim ut sem viverra aliquet. Sed euismod nisi porta lorem mollis aliquam ut porttitor. Eget duis at tellus at urna condimentum mattis pellentesque. A condimentum vitae sapien pellentesque habitant morbi tristique senectus et. Viverra aliquet eget sit amet tellus cras adipiscing enim.</p><p><span class=\"fr-emoticon fr-deletable fr-emoticon-img\" style=\"background: url(https://cdnjs.cloudflare.com/ajax/libs/emojione/2.0.1/assets/svg/1f60e.svg);\">&nbsp;</span>&nbsp;</p>\r\n",
    "ItemTags": null,
    "Author_Name": "DEMO Author One",
    "Author_Url": "/_author/demo-author-one",
    "Author": 2274,
    "SEOTitle": "",
    "MetaTitle": "",
    "MetaDescription": "",
    "ShowPageForSearchEngine": true,
    "CanonicalLink": "",
    "EnableAMP": false,
    "AMPContent": "",
    "CodeEditor": true,
    "ExternalId": 0,
    "SocialMetaTags": "",
    "OpenGraphProperties": "",
    "DisableForSiteSearch": false,
    "SeoPriority": "",
    "CreatedByMemberId": 0,
    "ItemCategories": null,
    "ItemCategoryIdList": null,
    "SKUCode": "",
    "SiteSearchKeywords": "",
    "Image": null
  },
  {
    "Id": 2287,
    "Url": "/demo-custom-blog/sample-post-one",
    "ParentId": 2286,
    "LastUpdatedDate": "2020-04-30T10:14:34",
    "Name": "Sample Post One",
    "UrlSlug": "sample-post-one",
    "Enabled": true,
    "ReleaseDate": "2019-04-14T18:00:00",
    "ExpiryDate": "2099-12-10T18:00:00",
    "Weighting": 0,
    "Description": "<p>Orci phasellus egestas tellus rutrum tellus pellentesque. Sed enim ut sem viverra aliquet. Sed euismod nisi porta lorem mollis aliquam ut porttitor. Eget duis at tellus at urna condimentum mattis pellentesque. A condimentum vitae sapien pellentesque habitant morbi tristique senectus et. Viverra aliquet eget sit amet tellus cras adipiscing enim.</p>\r\n<p>Non tellus orci ac auctor augue mauris. In hendrerit gravida rutrum quisque non. Morbi tempus iaculis urna id volutpat lacus laoreet. Nulla aliquet enim tortor at. Erat velit scelerisque in dictum non. Neque gravida in fermentum et sollicitudin ac orci phasellus. Luctus venenatis lectus magna fringilla urna porttitor. Lorem sed risus ultricies tristique nulla aliquet. Non consectetur a erat nam.</p>\r\n<p>Fames ac turpis egestas maecenas. Nibh sit amet commodo nulla facilisi. Id eu nisl nunc mi ipsum faucibus vitae aliquet. Quis viverra nibh cras pulvinar. Enim nulla aliquet porttitor lacus luctus accumsan tortor posuere ac. Orci eu lobortis elementum nibh tellus molestie nunc. Ut sem nulla pharetra diam sit amet. Massa vitae tortor condimentum lacinia quis vel eros.</p>\r\n<p>Sodales ut eu sem integer vitae justo eget. At risus viverra adipiscing at in tellus integer. Ac odio tempor orci dapibus ultrices. Diam ut venenatis tellus in metus vulputate eu scelerisque felis. Commodo ullamcorper a lacus vestibulum.</p>",
    "ItemTags": [
      "demo",
      "blog posts",
      "sample"
    ],
    "Author_Name": "DEMO Author One",
    "Author_Url": "/_author/demo-author-one",
    "Author": 2274,
    "SEOTitle": "",
    "MetaTitle": "",
    "MetaDescription": "",
    "ShowPageForSearchEngine": true,
    "CanonicalLink": "",
    "EnableAMP": false,
    "AMPContent": "",
    "CodeEditor": true,
    "ExternalId": 0,
    "SocialMetaTags": "",
    "OpenGraphProperties": "",
    "DisableForSiteSearch": false,
    "SeoPriority": "",
    "CreatedByMemberId": 0,
    "ItemCategories": [
      "Blog: News & Events"
    ],
    "ItemCategoryIdList": [
      "1"
    ],
    "SKUCode": "",
    "SiteSearchKeywords": "",
    "Image": "/images/community-img-01.jpg"
  },
  {
    "Id": 2319,
    "Url": "/demo-custom-blog/sample-post-three",
    "ParentId": 2286,
    "LastUpdatedDate": "2020-02-23T23:29:31",
    "Name": "Sample Post Three",
    "UrlSlug": "sample-post-three",
    "Enabled": true,
    "ReleaseDate": "2019-01-18T18:00:00",
    "ExpiryDate": "2099-12-10T18:00:00",
    "Weighting": 0,
    "Description": "<p>Orci phasellus egestas tellus rutrum tellus pellentesque. Sed enim ut sem viverra aliquet. Sed euismod nisi porta lorem mollis aliquam ut porttitor. Eget duis at tellus at urna condimentum mattis pellentesque. A condimentum vitae sapien pellentesque habitant morbi tristique senectus et. Viverra aliquet eget sit amet tellus cras adipiscing enim.</p><p>Non tellus orci ac auctor augue mauris. In hendrerit gravida rutrum quisque non. Morbi tempus iaculis urna id volutpat lacus laoreet. Nulla aliquet enim tortor at. Erat velit scelerisque in dictum non. Neque gravida in fermentum et sollicitudin ac orci phasellus. Luctus venenatis lectus magna fringilla urna porttitor. Lorem sed risus ultricies tristique nulla aliquet. Non consectetur a erat nam.</p><p>Fames ac turpis egestas maecenas. Nibh sit amet commodo nulla facilisi. Id eu nisl nunc mi ipsum faucibus vitae aliquet. Quis viverra nibh cras pulvinar. Enim nulla aliquet porttitor lacus luctus accumsan tortor posuere ac. Orci eu lobortis elementum nibh tellus molestie nunc. Ut sem nulla pharetra diam sit amet. Massa vitae tortor condimentum lacinia quis vel eros.</p><p>Sodales ut eu sem integer vitae justo eget. At risus viverra adipiscing at in tellus integer. Ac odio tempor orci dapibus ultrices. Diam ut venenatis tellus in metus vulputate eu scelerisque felis. Commodo ullamcorper a lacus vestibulum.</p><p>Orci phasellus egestas tellus rutrum tellus pellentesque. Sed enim ut sem viverra aliquet. Sed euismod nisi porta lorem mollis aliquam ut porttitor. Eget duis at tellus at urna condimentum mattis pellentesque. A condimentum vitae sapien pellentesque habitant morbi tristique senectus et. Viverra aliquet eget sit amet tellus cras adipiscing enim.</p><p>Non tellus orci ac auctor augue mauris. In hendrerit gravida rutrum quisque non. Morbi tempus iaculis urna id volutpat lacus laoreet. Nulla aliquet enim tortor at. Erat velit scelerisque in dictum non. Neque gravida in fermentum et sollicitudin ac orci phasellus. Luctus venenatis lectus magna fringilla urna porttitor. Lorem sed risus ultricies tristique nulla aliquet. Non consectetur a erat nam.</p><p>Fames ac turpis egestas maecenas. Nibh sit amet commodo nulla facilisi. Id eu nisl nunc mi ipsum faucibus vitae aliquet. Quis viverra nibh cras pulvinar. Enim nulla aliquet porttitor lacus luctus accumsan tortor posuere ac. Orci eu lobortis elementum nibh tellus molestie nunc. Ut sem nulla pharetra diam sit amet. Massa vitae tortor condimentum lacinia quis vel eros.</p><p>Sodales ut eu sem integer vitae justo eget. At risus viverra adipiscing at in tellus integer. Ac odio tempor orci dapibus ultrices. Diam ut venenatis tellus in metus vulputate eu scelerisque felis. Commodo ullamcorper a lacus vestibulum.</p>",
    "ItemTags": null,
    "Author_Name": null,
    "Author_Url": null,
    "Author": "",
    "SEOTitle": "",
    "MetaTitle": "",
    "MetaDescription": "",
    "ShowPageForSearchEngine": true,
    "CanonicalLink": "",
    "EnableAMP": false,
    "AMPContent": "",
    "CodeEditor": false,
    "ExternalId": 0,
    "SocialMetaTags": "",
    "OpenGraphProperties": {
      "title": "",
      "type": "",
      "url": "",
      "locale": "",
      "image": ""
    },
    "DisableForSiteSearch": false,
    "SeoPriority": "",
    "CreatedByMemberId": 0,
    "ItemCategories": null,
    "ItemCategoryIdList": null,
    "SKUCode": "",
    "SiteSearchKeywords": "",
    "Image": "/images/community-img-01.jpg"
  }
],
  "Params": {},
  "Parent": {
  "Id": 2142,
  "Url": "/component-types/module-blog-post",
  "ParentId": 2127,
  "LastUpdatedDate": "2020-05-20T00:49:19",
  "Name": "module (Blog Post)",
  "UrlSlug": "module-blog-post",
  "Enabled": true,
  "ReleaseDate": "2018-09-05T00:00:00",
  "ExpiryDate": "2099-12-09T00:00:00",
  "Weighting": 969,
  "Description": "\n\n<p>This module component fetches data relating to Blog Posts.</p>\n\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{data}}\", lang: \"liquid\" %}\n\n\n{% component type: \"snippet\", alias: \"section_parameters\" %}\n\n{% component type: \"snippet\", alias: \"param_table_head\" %}\n    {% component type: \"snippet\", alias: \"param_type\", required: \"true\", values: \"module <em>(default)</em>,module_of_member\" %}\n    {% component type: \"snippet\", alias: \"param_source\", required: \"true\", values: \"Blog Post <em>(default)</em>\" %}\n    {% component type: \"snippet\", alias: \"param_layout\", required: \"true\", values: \"List <em>(default)</em><br>&lt;Your Layout name&gt;\" %}\n    {% component type: \"snippet\", alias: \"param_filterby\" %}\n    {% component type: \"snippet\", alias: \"param_filtervalue\" %}\n    {% component type: \"snippet\", alias: \"param_sortby\" %}\n    {% component type: \"snippet\", alias: \"param_sortorder\" %}\n    {% component type: \"snippet\", alias: \"param_random\" %}\n    {% component type: \"snippet\", alias: \"param_limit\" %}\n    {% component type: \"snippet\", alias: \"param_displaypagination\" %}\n    {% component type: \"snippet\", alias: \"param_emptymessage\" %}\n    {% component type: \"snippet\", alias: \"param_object\" %}\n    {% component type: \"snippet\", alias: \"param_collectionvariable\" %}\n    {% component type: \"snippet\", alias: \"param_issearchresult\" %}\n    {% component type: \"snippet\", alias: \"param_searchscope\" %}\n    {% component type: \"snippet\", alias: \"param_customparameter\" %}\n{% component type: \"snippet\", alias: \"param_table_foot\" %}\n\n\n{% component type: \"snippet\", alias: \"section_output\" %}\n{% component source: \"Blog Post\", layout: "", type: \"module\", limit: \"3\", collectionVariable: \"allPosts\" %}\n<p>The below example has 3 sample <code>items</code> but is otherwise the default structure you will get from this Component.</p>\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{allPosts}}\", lang: \"json\" %}\n\n{% component type: \"snippet\", alias: \"section_accessing_data\" %}\n\n<p>This data is accessible in two main ways:</p>\n\n<p>1. Using Liquid in the specified Layout via the <code>this</code> object.</p>\n\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{data}}\", lang: \"liquid\" %}\n\n<p>2. Directly on the Page or Template via a Liquid Collection if <code>collectionVariable</code> was added to the Component tag.</p>\n\n<p>An example using <code>collectionVariable</code> with value \"allPosts\" to list all \"Blog Posts\" across the site:</p>\n<p class=\"notice-note\">Here we suppress any Layout from rendering by setting <code>layout: \"\"</code> as an empty attribute.</p>\n\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{data}}\", lang: \"liquid\" %}\n\n<p><em>Looping through the collection to render all the item URLs in a list, giving us:</em></p>\n\n<ul>\n    \n        <li>/demo-html-blog/demo-html-post</li>\n    \n        <li>/demo-custom-blog/sample-post-one</li>\n    \n        <li>/demo-custom-blog/sample-post-three</li>\n    \n</ul>\n<br>\n<p><em>The code:</em></p>\n\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{data}}\", lang: \"liquid\" %}\n\n<p><em>Accessing a specific item within the collection. In this case the third item (zero based index), which in our example would render the value <code>/demo-custom-blog/sample-post-three</code></em></p>\n\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{data}}\", lang: \"liquid\" %}\n\n<h2 id=\"secListFilteredPosts\">List Posts from a specific Blog</h2>\n<p>If you have more than one Blog on your site the above examples will list Posts from all Blogs as one single collection. However, typically you'd want to list all Posts from only the Blog they belong to (their \"parent\" Blog).</p>\n<p>To do this we add the <code>filterBy</code> and <code>filterValue</code> attributes to the Component tag.</p>\n<p>Typically, you would be listing Blog specific Posts on your Blog detail page/index page. In which case you would be editing the 'General Blog Layout' to insert your Component tag, which would look like this:</p>\n\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{data}}\", lang: \"liquid\" %}\n\n<p>As we are within the Blog's detail Layout (which represents the 'parent' Blog) we can reference its ID for the filter value using <code>{{this['id']}}</code> and instruct the Component tag to filter the Posts only by their parent (<code>filterBy: \"parentID\"</code>) - giving us only the relevant Posts for the current Blog.</p>\n<p>You may however, want to render a list of Posts on a standard page or within another modules layout,  where the Post's parent ID (the Blog it belongs to) is not readily available to us in the Liquid scope. In this case you would need to manually hardcode the desired parent Blog's ID into the component tag in place of the above Liquid generated ID (<code>filterValue: \"1234\"</code>).</p>\n<p class=\"notice-tip\">To obtain the Blog's ID from the admin, go to that Blog's list view (where you can see all of the Posts) and note the number in the URL address bar shown after the <code>parentID=</code> parameter.</p>\n\n{% component type: \"snippet\", alias: \"section_counter\" %}\n",
  "ItemTags": [
  "Blogs"
],
  "Author_Name": "",
  "Author_Url": "",
  "Author": "",
  "SEOTitle": "",
  "MetaTitle": "",
  "MetaDescription": "",
  "ShowPageForSearchEngine": true,
  "CanonicalLink": "",
  "EnableAMP": false,
  "AMPContent": "",
  "CodeEditor": true,
  "ExternalId": 0,
  "SocialMetaTags": "",
  "OpenGraphProperties": "",
  "DisableForSiteSearch": false,
  "SeoPriority": "",
  "CreatedByMemberId": 0,
  "ItemCategories": "",
  "ItemCategoryIdList": "",
  "SKUCode": "",
  "SiteSearchKeywords": "",
  "Active": true,
  "IgnoreUpdates": false,
  "UpdateNotes": "'module_of_member' parameter details added.",
  "ExternalResources": "<ul><li><a href=\"/demo-cs/all-posts\">Demo Site All Posts</a></li><li><a href=\"/demo-html-blog\">Demo Site Blog</a></li></ul>",
  "AdditionalRelatedArticle_Name": "",
  "AdditionalRelatedArticle_Url": "",
  "AdditionalRelatedArticle": "",
  "AdditionalRelatedArticle2_Name": "",
  "AdditionalRelatedArticle2_Url": "",
  "AdditionalRelatedArticle2": "",
  "Authors": "2418",
  "Pagination": {
  "CurrentPage": 1,
  "ItemsPerPage": 1,
  "NumberOfPages": 1,
  "TotalItemsCount": 1
},
  "Params": {},
  "Parent": {
  "Id": 2361,
  "Url": "/bc-migration-guides/bc-liquid-comparisons",
  "ParentId": 2355,
  "LastUpdatedDate": "2020-04-29T19:51:07",
  "Name": "BC Liquid Comparisons",
  "UrlSlug": "bc-liquid-comparisons",
  "Enabled": true,
  "ReleaseDate": "2019-02-28T00:00:00",
  "ExpiryDate": "2099-12-11T00:00:00",
  "Weighting": 700,
  "Description": "<p>Below are some typical BC Liquid and tags you may be using and their closest Treepl CMS comparisons.</p>\n\n  \n  <table style=\"width: 100%;\">\n    <thead>\n        <tr>\n            <th><h2 id=\"secItem\">Item Data</h2></th>\n        </tr>\n    </thead>\n    <tbody>      \n        \n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Page Name</b><br><code>{module_pagename}</code><br><small>eg: \"About\"</small>\n            <br class=\"space\"><br class=\"space\">\n            <b>Treepl CMS:</b><br><code>&#123;&#123;this.name&#125;&#125;</code><br><small>Name of current item (within the context/scope of the template/layout where it is placed)</small></td>\n        </tr>\n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Page Title</b><br><code>{module_pagetitle}</code><br><small>eg: \"About ABC Company\"</small>\n            <br class=\"space\"><br class=\"space\">\n            <b>Treepl CMS:</b><br><code>&#123;&#123;this.seotitle&#125;&#125;</code><br><small>Meta title of current item (within the context/scope of the template/layout where it is placed)</small></td>\n        </tr>\n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Page ID</b><br><code>{module_oid}</code><br><small>eg: \"12345\"</small>\n            <br class=\"space\"><br class=\"space\">\n            <b>Treepl CMS:</b><br><code>&#123;&#123;this.id&#125;&#125;</code><br><small>ID of current item (within the context/scope of the template/layout where it is placed)</small></td>\n        </tr>\n </tbody>\n</table>\n        <div class=\"tab-content faqsOpenCloseHolder\">\n    <div class=\"faqs-open-close \">\n        <a class=\"opener\" href=\"#\"><i class=\"fas fa-angle-right\"></i>\"this\" Documentation</a>\n        <div class=\"slide js-slide-hidden\">\n  {% component source: \"Documentation Post\", layout: \"Body Detail\", filterBy: \"id\", filterValue: \"2324\", limit: \"1\", type: \"module\" %}\n  </div>\n    </div>\n    </div>\n  <p><br><br></p>       \n        \n        \n        \n  \n  \n  \n  \n<table style=\"width: 100%;\">\n    <thead>\n        <tr>\n            <th><h2 id=\"secSystem\">System Data</h2></th>\n        </tr>\n    </thead>\n    <tbody>        \n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Page URL and URL Parameters</b><br><code>{module_url param=\"param1\"} and {module_pageaddress}</code><br><small>eg: {<br>\n  \"ID\": \"/test2.html\",<br>\n  \"question\": \"true\",<br>\n}</small>\n<br class=\"space\"><br class=\"space\">\n<b>Treepl CMS:</b><br><code>&#123;&#123;request.request_url&#125;&#125;</code><br><small>Output: {<br>\n    \"href\": \"https://docs.treepl.co/test2?question=true\",<br>\n    \"origin\": \"https://docs.treepl.co\",<br>\n    \"protocol\": \"https\",<br>\n    \"hostname\": \"docs.treepl.co\",<br>\n    \"path\": \"/test2\",<br>\n    \"params\": {<br>\n      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"question\": \"true\"<br>\n    &nbsp;&nbsp;&nbsp;&nbsp;}<br>\n    }</small></td>\n        </tr>\n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Referral Address</b><br><code>{module_referreraddress}</code><br><small>eg: \"http://mysite.com/page1\"</small>\n            <br class=\"space\"><br class=\"space\">\n            <b>Treepl CMS:</b><br><code>&#123;&#123;request.request_data.referrer&#125;&#125;</code><br><small>&nbsp;</small></td>\n        </tr>\n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Globals and Visitor IP Address</b><br><code>{module_visitoripaddress} and &#123;&#123;globals.visitor&#125;&#125;</code><br><small>eg: \"193.2.2.2\"<br><br>{<br>\n  \"deviceClass\": \"desktop\",<br>\n  \"ip\": \"193.2.2.2\",<br>\n  \"country\": \"RO\",<br>\n  \"userAgent\": \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.103 Safari/537.36\"<br>\n}</small>\n<br class=\"space\"><br class=\"space\">\n<b>Treepl CMS:</b><br><code>&#123;&#123;request.request_data&#125;&#125;</code><br><small>Output: {<br>\n    \"ip\": \"193.2.2.2\",<br>\n    \"is_mobile\": 0,<br>\n    \"user_agent\": \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.103 Safari/537.36\",<br>\n    \"referrer\": \"/page1\"<br>\n  }</small></td>\n        </tr>\n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Visitor Device Class</b><br><code>{system_visitordeviceclass}</code><br><small>eg: \"desktop\", \"phone\" or \"tablet\"</small>\n            <br class=\"space\"><br class=\"space\">\n            <b>Treepl CMS:</b><br><code>&#123;&#123;request.device_type&#125;&#125;</code><br><small>Output: \"Desktop\", \"Tablet\", \"Mobile\"</small></td>\n        </tr>\n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Logged In User</b><br><code>&#123;&#123;globals.user&#125;&#125; and {module_isloggedin}</code><br><small>eg: \"1\" or \"0\"<br><br>{<br>\n  \"firstname\": \"Alex\",<br>\n  \"lastname\": \"Smith\",<br>\n  \"fullname\": \"Alex Smith\",<br>\n  \"email\": \"asmith@example.com\",<br>\n  \"isLoggedIn\": true<br>\n}</small>\n<br class=\"space\"><br class=\"space\">\n<b>Treepl CMS:</b><br><code>&#123;&#123;request.is_logged&#125;&#125; and &#123;&#123;request.currentmember&#125;&#125;</code><br><small>Output: \"true\" or \"false\"<br><br>{<br>\n        \"id\": 162,<br>\n        \"email\": \"asmith@example.com\",<br>\n        \"firstname\": \"Alex\",<br>\n        \"lastname\": \"Smith\",<br>\n        \"address\": null,<br>\n        \"city\": null,<br>\n        \"state\": null,<br>\n        \"zipcode\": null,<br>\n        \"country\": \"Australia\",<br>\n        \"site\": null,<br>\n        \"phone\": null,<br>\n        \"createddatetime\": \"2018-11-21T15:17:22.717\",<br>\n        \"updateddatetime\": \"2018-11-21T15:17:22.763\",<br>\n        \"securezones\": [<br>\n            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>\n            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"id\": 2,<br>\n            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"name\": \"Members Secure Zone\",<br>\n            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"landingpageid\": 2541,<br>\n            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"createddatetime\": \"2018-11-21T15:17:23.037\",<br>\n            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"updateddatetime\": \"2018-11-21T15:17:23.037\"<br>\n            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>\n        &nbsp;&nbsp;&nbsp;&nbsp;]<br>\n    }</small></td>\n        </tr>\n         </tbody>\n</table>\n        <div class=\"tab-content faqsOpenCloseHolder\">\n    <div class=\"faqs-open-close \">\n        <a class=\"opener\" href=\"#\"><i class=\"fas fa-angle-right\"></i>\"request\" Documentation</a>\n        <div class=\"slide js-slide-hidden\">\n  {% component source: \"Documentation Post\", layout: \"Body Detail\", filterBy: \"id\", filterValue: \"1964\", limit: \"1\", type: \"module\" %}\n  </div>\n    </div>\n    </div>\n\n     \n     \n     \n     \n     \n        \n<table style=\"width: 100%;\">\n    <thead>\n        <tr>\n            <th><h2 id=\"secContent\">Content Modules</h2></th>\n        </tr>\n    </thead>\n    <tbody>      \n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: WebApp listing module</b><br><code>{module_webapps render=\"item|collection\" id=\"webappId|webappName\" filter=\"item\" itemId=\"123\" targetFrame=\"\" resultsPerPage=\"\" hideEmptyMessage=\"false\" rowCount=\"\" sortType=\"ALPHABETICAL\" collection=\"my_custom_collection_name\" template=\"/folder/template.tpl\"}</code><br><small>eg: <ul>\n    <li>My WebApp Item 1</li>\n    <li>My WebApp Item 2</li>\n    <li>My WebApp Item 3</li>\n</ul></small>\n<br class=\"space\"><br class=\"space\">\n<b>Treepl CMS:</b><br><code>{% component type: \"module\", object: \"item|collection\", source: \"&lt;Custom Module name/ID&gt;\", filterBy: \"id\", filterValue: \"123\", limit: \"10\", emptyMessage: \"&lt;your content&gt;\", sortBy: \"name\", collectionVariable: \"my_custom_collection_name\", layout: \"List 1\" %}</code><br><small>Notes: No \"targetFrame\" or \"rowCount\" equivalents as no longer necessary.<br>Fully documented Component parameters below.</small></td>\n        </tr>\n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Blog's Post listing module</b><br><code>{module_blogpostlist render=\"item|collection\" collection=\"my_custom_collection_name\" template=\"/folder/template.tpl\" blogId=\"12345\" rowCount=\"10\" tag=\"tag\"}</code><br><small>eg: <ul>\n    <li>My Blog Post 1</li>\n    <li>My Blog Post 2</li>\n    <li>My Blog Post 3</li>\n</ul></small>\n<br class=\"space\"><br class=\"space\">\n<b>Treepl CMS:</b><br><code>{% component type: \"module\", object: \"item|collection\", collectionVariable: \"my_custom_collection_name\", layout: \"List\", filterBy: \"parentid\", filterValue: \"12345\", source: \"Blog Post\" %}</code><br><small>Notes: No \"rowCount\" equivalent as no longer necessary. Tag filtering can by done via teh \"filterBy\" parameter or via Liquid conditions in the layout or collection.<br>Fully documented Component parameters below.</small></td>\n        </tr>\n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Form module</b><br><code>{module_webform id=\"1234\"\"}</code><br><small>eg: <ul>\n    <li>My Menu Item 1</li>\n    <li>My Menu Item 2</li>\n    <li>My Menu Item 3</li>\n</ul></small>\n<br class=\"space\"><br class=\"space\">\n<b>Treepl CMS:</b><br><code>{% component type: \"menu\", alias: \"&lt;menu_alias&gt;\" %}</code><br><small>Fully documented Component parameters below.</small></td>\n        </tr>\n </tbody>\n</table>       \n    \n   \n   <div class=\"tab-content faqsOpenCloseHolder\">\n    <div class=\"faqs-open-close \">\n        <a class=\"opener\" href=\"#\"><i class=\"fas fa-angle-right\"></i>Custom Module Component Documentation</a>\n        <div class=\"slide js-slide-hidden\">\n   {% component source: \"Documentation Post\", layout: \"Body Detail\", filterBy: \"id\", filterValue: \"1960\", limit: \"1\", type: \"module\" %}\n   </div>\n    </div>\n    </div>\n   \n   <div class=\"tab-content faqsOpenCloseHolder\">\n    <div class=\"faqs-open-close \">\n        <a class=\"opener\" href=\"#\"><i class=\"fas fa-angle-right\"></i>Blog Post Component Documentation</a>\n        <div class=\"slide js-slide-hidden\">\n   {% component source: \"Documentation Post\", layout: \"Body Detail\", filterBy: \"id\", filterValue: \"2142\", limit: \"1\", type: \"module\" %}\n   </div>\n    </div>\n    </div>\n   \n   \n   <div class=\"tab-content faqsOpenCloseHolder\">\n    <div class=\"faqs-open-close \">\n        <a class=\"opener\" href=\"#\"><i class=\"fas fa-angle-right\"></i>Menu Component Documentation</a>\n        <div class=\"slide js-slide-hidden\">\n   {% component source: \"Documentation Post\", layout: \"Body Detail\", filterBy: \"id\", filterValue: \"1958\", limit: \"1\", type: \"module\" %}\n   </div>\n    </div>\n    </div>\n  <p><br><br></p>      \n        \n        \n        \n        \n\n\n\n<table style=\"width: 100%;\">\n    <thead>\n        <tr>\n            <th><h2 id=\"secSyntax\">Dates, Filters &amp; General Syntax</h2></th>\n        </tr>\n    </thead>\n    <tbody>\n        \n        <tr>\n            <td style=\"font-weight: normal;\"><b>BC: Current Date (from server)</b><br><code>&#123;&#123; globals.site.dateNow | datetime &#125;&#125;</code><br><small>eg: \"09-Jan-2015 02:46 PM\"</small>\n            <br class=\"space\"><br class=\"space\">\n            <b>Treepl CMS:</b><br><code>&#123;&#123; \"now\" | date: \"%d-%b-%Y %I:%M %p\"  &#125;&#125;</code><br><small>Date formatting examples in the Liquid documentation <a href=\"https://shopify.github.io/liquid/filters/date/\" target=\"_blank\">here</a>, a very useful tool for generating date formats can be found at <a href=\"http://strftime.net/\" target=\"_blank\">STRFTIME.net</a></small></td>\n        </tr>\n  </tbody>\n</table>      \n        <div class=\"tab-content faqsOpenCloseHolder\">\n    <div class=\"faqs-open-close \">\n        <a class=\"opener\" href=\"#\"><i class=\"fas fa-angle-right\"></i>Liquid Syntax Documentation</a>\n        <div class=\"slide js-slide-hidden\">\n    {% component source: \"Documentation Post\", layout: \"Body Detail\", filterBy: \"id\", filterValue: \"2128\", limit: \"1\", type: \"module\" %}\n    </div>\n    </div>\n    </div>\n  <p><br><br></p>\n  \n   ",
  "ItemTags": [
  "Migrations"
],
  "Author_Name": "",
  "Author_Url": "",
  "Author": "",
  "SEOTitle": "",
  "MetaTitle": "",
  "MetaDescription": "",
  "ShowPageForSearchEngine": true,
  "CanonicalLink": "",
  "EnableAMP": false,
  "AMPContent": "",
  "CodeEditor": true,
  "ExternalId": 0,
  "SocialMetaTags": "",
  "OpenGraphProperties": "",
  "DisableForSiteSearch": false,
  "SeoPriority": "",
  "CreatedByMemberId": 0,
  "ItemCategories": "",
  "ItemCategoryIdList": "",
  "SKUCode": "",
  "SiteSearchKeywords": "",
  "Active": true,
  "IgnoreUpdates": true,
  "UpdateNotes": "Added external resource link for BC to Treepl App conversion info.",
  "ExternalResources": "<ul><li><a href=\"https://forum.treepl.co/t/bc-to-treepl-app-updates-announcements-and-discussions/497\" rel=\"noopener noreferrer\" target=\"_blank\" title=\"\">BC to Treepl CMS App - Liquid and Tag Conversions</a></li></ul>",
  "AdditionalRelatedArticle_Name": "",
  "AdditionalRelatedArticle_Url": "",
  "AdditionalRelatedArticle": "",
  "AdditionalRelatedArticle2_Name": "",
  "AdditionalRelatedArticle2_Url": "",
  "AdditionalRelatedArticle2": "",
  "Authors": "2418",
  "ParentName": "BC Migration Guides",
  "ParentUrl": "/bc-migration-guides",
  "TemplateName": "Docs Template",
  "IsHome": false
}
}
}

Accessing the Data

This data is accessible in two main ways:

1. Using Liquid in the specified Layout via the this object.

{{this['url']}}

2. Directly on the Page or Template via a Liquid Collection if collectionVariable was added to the Component tag.

An example using collectionVariable with value "allPosts" to list all "Blog Posts" across the site:

Here we suppress any Layout from rendering by setting layout: "" as an empty attribute.

{% component type: "module", source: "Blog Posts", layout: "", collectionVariable: "allPosts" %}

Looping through the collection to render all the item URLs in a list, giving us:

  • /demo-html-blog/demo-html-post
  • /demo-custom-blog/sample-post-one
  • /demo-custom-blog/sample-post-three

The code:

<ul>
    {% for i in allPosts.items %}
        <li>{{i['url']}}</li>
    {% endfor %}
</ul>

Accessing a specific item within the collection. In this case the third item (zero based index), which in our example would render the value /demo-custom-blog/sample-post-three

{{allPosts.items[2]['url']}}

List Posts from a specific Blog

If you have more than one Blog on your site the above examples will list Posts from all Blogs as one single collection. However, typically you'd want to list all Posts from only the Blog they belong to (their "parent" Blog).

To do this we add the filterBy and filterValue attributes to the Component tag.

Typically, you would be listing Blog specific Posts on your Blog detail page/index page. In which case you would be editing the 'General Blog Layout' to insert your Component tag, which would look like this:

{% component type: "module", source: "Blog Posts", layout: "List", filterBy: "parentId", filterValue: "{{this['id']}}" %}

As we are within the Blog's detail Layout (which represents the 'parent' Blog) we can reference its ID for the filter value using {{this['id']}} and instruct the Component tag to filter the Posts only by their parent (filterBy: "parentID") - giving us only the relevant Posts for the current Blog.

You may however, want to render a list of Posts on a standard page or within another modules layout, where the Post's parent ID (the Blog it belongs to) is not readily available to us in the Liquid scope. In this case you would need to manually hardcode the desired parent Blog's ID into the component tag in place of the above Liquid generated ID (filterValue: "1234").

To obtain the Blog's ID from the admin, go to that Blog's list view (where you can see all of the Posts) and note the number in the URL address bar shown after the parentID= parameter.

Counter

Along with the data output above, there is also a special liquid tag available {{counter}} which increments for each item. This tag is only available within Layouts when object: "item" is used in the Component tag.

Menu Component Documentation

View full article

This component outputs data relating to a specific Form.

{% component type: "form", alias: "<form_alias>" %}

Parameters and Options

Parameter Values Required Description
type form

This is the name of the entity that needs to be used for the component retrieving function.

module is the standard retrieving function to retrieve all items.

module_of_member retrieves only those items "Added by" the currently logged in user (identified by the CreatedByMemberId property in the module items Liquid data).

The "Added by" System Property will only be available where the modules settings have "Allow Add New Items" turned on under the "Site User Permissions".

alias <alias_name> The alias name of the module.
collectionVariable <yourLiquidVariableName>
Assigns the data to a Liquid collection enabling further access to the data on the Page or Template using Liquid.
If using this parameter, the form will not render its layout.

Your collectionVariable value must only contain English letters, numbers or underscores. Spaces or special characters are not supported.

type <number>
If the form is collecting payment as type 'Generic', this parameter can be used to pass the price value to the form.

module is the standard retrieving function to retrieve all items.

module_of_member retrieves only those items "Added by" the currently logged in user (identified by the CreatedByMemberId property in the module items Liquid data).

The "Added by" System Property will only be available where the modules settings have "Allow Add New Items" turned on under the "Site User Permissions".

type <ID>
If the form is subscribing a user to an Event and/or is collecting payment as type 'SingleItem' for an Event subscription, this parameter is used to pass the Event ID to the form to assign the required Event and any price values for payment.

module is the standard retrieving function to retrieve all items.

module_of_member retrieves only those items "Added by" the currently logged in user (identified by the CreatedByMemberId property in the module items Liquid data).

The "Added by" System Property will only be available where the modules settings have "Allow Add New Items" turned on under the "Site User Permissions".

<customParameter> <your custom value>
You can add your own additional parameters (name/value pairs) to the Component tag. These will be passed to the Components Layout (and the collectionVariable if used) for use via Liquid.

Your <customParameter> name must only contain English letters, numbers or underscores. Spaces or special characters are not supported.

You can use HTML as the value here, just be sure to change any double quotes in your HTML to single quotes.

Liquid Output

The below form example has 4 system fields and 2 custom fields and represents the typical data structure you will see from this Component.

{
  "Name": "Sample Form",
  "Alias": "sample_form",
  "Fields": [
  {
    "Id": 162,
    "FormId": 10,
    "Name": "Email",
    "Alias": "Email",
    "CreatedDateTime": "2018-11-07T10:15:01.553",
    "UpdatedDateTime": "2018-11-07T10:15:01.553",
    "Type": 7,
    "IsMandatory": true,
    "IsSystem": true,
    "Options": [],
    "Order": 0
  },
  {
    "Id": 163,
    "FormId": 10,
    "Name": "First Name",
    "Alias": "FirstName",
    "CreatedDateTime": "2018-11-07T10:15:01.587",
    "UpdatedDateTime": "2018-11-07T10:15:01.587",
    "Type": 7,
    "IsMandatory": true,
    "IsSystem": true,
    "Options": [],
    "Order": 1
  },
  {
    "Id": 164,
    "FormId": 10,
    "Name": "Last Name",
    "Alias": "LastName",
    "CreatedDateTime": "2018-11-07T10:15:01.623",
    "UpdatedDateTime": "2018-11-07T10:15:01.623",
    "Type": 7,
    "IsMandatory": true,
    "IsSystem": true,
    "Options": [],
    "Order": 2
  },
  {
    "Id": 165,
    "FormId": 10,
    "Name": "Phone",
    "Alias": "Phone",
    "CreatedDateTime": "2018-11-07T10:15:01.657",
    "UpdatedDateTime": "2018-11-07T10:15:01.657",
    "Type": 7,
    "IsMandatory": false,
    "IsSystem": true,
    "Options": [],
    "Order": 3
  },
  {
    "Id": 166,
    "FormId": 10,
    "Name": "Enquiry",
    "Alias": "Enquiry",
    "CreatedDateTime": "2018-11-07T10:15:01.697",
    "UpdatedDateTime": "2018-11-07T10:15:01.697",
    "Type": 6,
    "IsMandatory": true,
    "IsSystem": false,
    "Options": [],
    "Order": 4
  },
  {
    "Id": 167,
    "FormId": 10,
    "Name": "reCAPTCHA v2",
    "Alias": "ReCAPTCHAV2",
    "CreatedDateTime": "2018-11-07T10:15:01.73",
    "UpdatedDateTime": "2018-11-07T10:15:01.73",
    "Type": 9,
    "IsMandatory": true,
    "IsSystem": false,
    "Options": [],
    "Order": 5
  }
],
  "Parent": {
  "Count": 47,
  "Items": [
    {
      "Key": "Id",
      "Value": {
        "Type": 4,
        "IsIntegral": false
      }
    },
    {
      "Key": "Url",
      "Value": {
        "Encode": true,
        "Type": 6
      }
    },
    {
      "Key": "ParentId",
      "Value": {
        "Type": 4,
        "IsIntegral": false
      }
    },
    {
      "Key": "LastUpdatedDate",
      "Value": {
        "Type": 7
      }
    },
    {
      "Key": "Name",
      "Value": {
        "Encode": true,
        "Type": 6
      }
    },
    {
      "Key": "UrlSlug",
      "Value": {
        "Encode": true,
        "Type": 6
      }
    },
    {
      "Key": "Enabled",
      "Value": {
        "Type": 2
      }
    },
    {
      "Key": "ReleaseDate",
      "Value": {
        "Type": 7
      }
    },
    {
      "Key": "ExpiryDate",
      "Value": {
        "Type": 7
      }
    },
    {
      "Key": "Weighting",
      "Value": {
        "Type": 4,
        "IsIntegral": false
      }
    },
    {
      "Key": "Description",
      "Value": {
        "Encode": true,
        "Type": 6
      }
    },
    {
      "Key": "ItemTags",
      "Value": {
        "Type": 1
      }
    },
    {
      "Key": "Author_Name",
      "Value": {
        "Type": 0
      }
    },
    {
      "Key": "Author_Url",
      "Value": {
        "Type": 0
      }
    },
    {
      "Key": "Author",
      "Value": {
        "Encode": true,
        "Type": 6
      }
    },
    {
      "Key": "SEOTitle",
      "Value": {
        "Encode": true,
        "Type": 6
      }
    },
    {
      "Key": "MetaTitle",
      "Value": {
        "Encode": true,
        "Type": 6
      }
    },
    {
      "Key": "MetaDescription",
      "Value": {
        "Encode": true,
        "Type": 6
      }
    },
    {
      "Key": "ShowPageForSearchEngine",
      "Value": {
        "Type": 2
      }
    },
    {
      "Key": "CanonicalLink",
      "Value": {
        "Encode": true,
        "Type": 6
      }
    },
    {
      "Key": "EnableAMP",
      "Value": {
        "Type": 2
      }
    },
    {
      "Key": "AMPContent",
      "Value": {
        "Encode": true,
        "Type": 6
      }
    },
    {
      "Key": "CodeEditor",
      "Value": {
        "Type": 2
      }
    },
    {
      "Key": "ExternalId",
      "Value": {
        "Type": 4,
        "IsIntegral": false
      }
    },
    {
      "Key": "SocialMetaTags",
      "Value": {
        "Encode": true,
        "Type": 6
      }
    },
    {
      "Key": "OpenGraphProperties",
      "Value": {
        "Encode": true,
        "Type": 6
      }
    },
    {
      "Key": "DisableForSiteSearch",
      "Value": {
        "Type": 2
      }
    },
    {
      "Key": "SeoPriority",
      "Value": {
        "Encode": true,
        "Type": 6
      }
    },
    {
      "Key": "CreatedByMemberId",
      "Value": {
        "Type": 4,
        "IsIntegral": false
      }
    },
    {
      "Key": "ItemCategories",
      "Value": {
        "Type": 0
      }
    },
    {
      "Key": "ItemCategoryIdList",
      "Value": {
        "Type": 0
      }
    },
    {
      "Key": "SKUCode",
      "Value": {
        "Encode": true,
        "Type": 6
      }
    },
    {
      "Key": "SiteSearchKeywords",
      "Value": {
        "Encode": true,
        "Type": 6
      }
    },
    {
      "Key": "Active",
      "Value": {
        "Type": 2
      }
    },
    {
      "Key": "IgnoreUpdates",
      "Value": {
        "Type": 2
      }
    },
    {
      "Key": "UpdateNotes",
      "Value": {
        "Encode": true,
        "Type": 6
      }
    },
    {
      "Key": "ExternalResources",
      "Value": {
        "Encode": true,
        "Type": 6
      }
    },
    {
      "Key": "AdditionalRelatedArticle_Name",
      "Value": {
        "Type": 0
      }
    },
    {
      "Key": "AdditionalRelatedArticle_Url",
      "Value": {
        "Type": 0
      }
    },
    {
      "Key": "AdditionalRelatedArticle",
      "Value": {
        "Encode": true,
        "Type": 6
      }
    },
    {
      "Key": "AdditionalRelatedArticle2_Name",
      "Value": {
        "Type": 0
      }
    },
    {
      "Key": "AdditionalRelatedArticle2_Url",
      "Value": {
        "Type": 0
      }
    },
    {
      "Key": "AdditionalRelatedArticle2",
      "Value": {
        "Encode": true,
        "Type": 6
      }
    },
    {
      "Key": "Authors",
      "Value": {
        "Encode": true,
        "Type": 6
      }
    },
    {
      "Key": "Pagination",
      "Value": {
        "Type": 3
      }
    },
    {
      "Key": "Params",
      "Value": {
        "Type": 3
      }
    },
    {
      "Key": "Parent",
      "Value": {
        "Type": 3
      }
    }
  ]
},
  "Params": {
  "alias": "sample_form",
  "collectionVariable": "data"
},
  "PaymentAmount": 0.0,
  "ModuleItemId": 0,
  "ModuleName": "",
  "FormType": "Generic"
}

Field Type Codes

From the data output you can identify the type of field created in the admin via it's Type property.
The various types are listed below:

  • DateTime - 1
  • CheckboxList & MailingLists - 2
  • DropdownList - 3
  • ListboxList - 4
  • RadioList - 5
  • Multiline - 6
  • String - 7
  • Boolean - 8
  • ReCAPTCHAV2 & ReCAPTCHAV3 - 9
  • Upload - 10
  • Password - 11
  • AcceptPayment - 12
  • AcceptEventSubscription - 13

System fields Email, FirstName, LastName, Phone, Site, Address, City, State, ZipCode, Country, Status, Secure Zone Expiry Date, Secure Zone Expiry Duration all use type 7, and field Notes uses type 6.

Accessing the Data

As an alternative, you can instead output the form data directly on the Page or Template via a Liquid Collection if collectionVariable was added to the Component tag.

An example using collectionVariable with value "formData" is as follows:

{% component type: "form", alias: "sample_form", collectionVariable: "formData" %}

Looping through the collection to render all the field names:

{% for f in formData.fields %}
    {{f['Name']}}<br>
{% endfor %}

Accessing a specific item within the collection. In this case the third fields name (zero based index):

{{formData.fields[2]['Name']}}



Dates, Filters & General Syntax

BC: Current Date (from server)
{{ globals.site.dateNow | datetime }}
eg: "09-Jan-2015 02:46 PM"

Treepl CMS:
{{ "now" | date: "%d-%b-%Y %I:%M %p" }}
Date formatting examples in the Liquid documentation here, a very useful tool for generating date formats can be found at STRFTIME.net
Liquid Syntax Documentation

View full article

Treepl has implemented the full standard Shopify Liquid library. See the External Resources below for relevant links.

Learning Liquid - Free Online Course

If you are new to Liquid, see our free online course to get up to speed: Learning Liquid for Treepl CMS.

Syntax Variations

The default syntax used throughout the system when inserting liquid property tags will use square brackets, single quotes and 'capital camel case' for the property name. See the following example:

{{this['PropertyName']}}

Although, keep in mind that all property names, including custom properties added in Custom Modules, are aliased to a single word all in lowercase (flat case) for the purpose of referencing that data via Liquid.
The 'capital camel case' used above is for readability only as liquid property tags are not case sensitive.
You can choose to use an upper or lowercase syntax here.

Furthermore, as all property names are aliased to a single 'flat case' word, you can optionally use a shorthand method for referencing your property names. Such as the example following:

{{this.PropertyName}} OR {{this.propertyname}}

Notice the removal of the square brackets and single quotes and the addition of the dot (.) separator.
The dot separator is required wherever the square bracket syntax is NOT used.

The square brackets and single quote syntax is part of the liquid syntax for scenarios where property names have spaces included. This is not required in Treepl.

Empty Values (null and nil)

Often scenarios arise where properties will have no value (empty), or are not present in the Liquid output and you may want to check for this condition in your Liquid code.

In Treepl's .NET implementation of Liquid, null is used as a special value when a value is empty or a property is not present - both conditions will resolve to a null result. As opposed to the Shopify's Ruby implementation using nil.

Therefore, a reliable way to check for all empty or not present conditions can be achieved as per the following example, where we are rendering something if the property is NOT equal to (!=) null (or an empty value):

{% if this['PropertyName'] != null %}	
    // Render something here
{% endif %}

For more info on null/nil and empty values, see the External Resources below for relevant links.





Related Articles

External Resources


Please let us know if you have any other contributions or know of any helpful resources you'd like to see added here.


Questions?

We are always happy to help with any questions you may have.
Send us a message at support@treepl.co and we will consult you as soon as possible.