CRM entity tags are used to load and display CRM data, or use other Adxstudio Portals framework services. These tags are Adxstudio-specific extensions to the Liquid language.

editable

Renders a given Adxstudio Portals CMS object as editable on the portal, for users with content editing permission for that object. Editable objects include page attributes, snippets, and web links.

{% editable page 'adx_copy' type: 'html', title: 'Page Copy', escape: false, liquid: true %}

{% editable snippets "Header" type: 'html' %}

<!--
An editable web link set required a specific DOM structure, with
certain classes on the containing element, as demonstrated here.
-->
{% assign primary_nav = weblinks["Primary Navigation"] %}
{% if primary_nav %}
<div {% if primary_nav.editable %}class="xrm-entity xrm-editable-adx_weblinkset"{% endif %}>
<ul>
<!-- Render weblinks... -->
</ul>
{% editable primary_nav %}
</div>
{% endif %}

The first parameter provided to editable is the editable object. For example, this may be a web link set, snippets, or the current page. The optional second parameter is to specify an attribute name or key within that object that is to be rendered and edited. This may be the name of an entity attribute, or a snippet name, for example.

After these initial parameters, the tag supports a number of optional named parameters.

Specifies a class attribute value for the root element rendered by this tag.

A default value to be rendered in the case that the editable item has no value.

A Boolean value indicating whether a value rendered by this tag will be HTML-encoded. This is false by default.

A Boolean value indicating whether any Liquid template code found within the text value rendered by this tag will be processed. This is true by default.

The name of the container HTML tags that will be rendered by this tag. This tag will render div elements by default. It is generally recommended that you choose between div or span as a value for this parameter.

Specifies a label for this editable item within the content editing interface. If none is provided, a friendly label will be generated automatically.

A string value indicating the type of editing interface to be presented, for editable text values. Valid values for this parameter are html or text. html is the default.

entitylist

Loads a given Entity List, by name or ID. The properties of the entity list can then be accessed using an entitylist object that will be available within the tag block. To render the actual result records of the entity list, use the entityview tag within the block.

If the entity list is loaded successfully, the content within the block will be rendered. If the entity list is not found, the block content will not be rendered.

{% entitylist name:"My Entity List" %}
Loaded entity list {{ entitylist.adx_name }}.
{% endentitylist %}

By default, the entitylist object will be given the variable name entitylist. Optionally, a different variable name can be provided.

{% entitylist my_list = name:"My Entity List" %}
Loaded entity list {{ my_list.adx_name }}.
{% endentitylist %}

Provide only one of id, name, or key to select the Entity List to load.

Loads an entity list by GUID ID. id must be a string that can be parsed as a GUID.

{% entitylist id:"936DA01F-9ABD-4d9d-80C7-02AF85C822A8" %}
Loaded entity list {{ entitylist.adx_name }}.
{% endentitylist %}

Generally, literal GUID strings will not be used. Instead, id will be specified using a GUID property of another variable.

{% entitylist id:page.adx_entitylist.id %}
Loaded entity list {{ entitylist.adx_name }}.
{% endentitylist %}

Loads an entity list by name.

{% entitylist name:"My Entity List" %}
Loaded entity list {{ entitylist.adx_name }}.
{% endentitylist %}

Loads an entity list by ID or name. If the provided key value can be parsed as a GUID, the entity list will be loaded by ID. Otherwise, it will be loaded by name.

<!-- key_variable can hold an ID or name -->
{% entitylist key:key_variable %}
Loaded entity list {{ entitylist.adx_name }}.
{% endentitylist %}

A CRM integer language code to select the entity list localized labels to be loaded. If no language_code is provided, the default language of the portal application CRM connection will be used.

{% entitylist name:"My Entity List", language_code:1033 %}
Loaded entity list {{ entitylist.adx_name }}.
{% endentitylist %}

entityview

Loads a given CRM view, by name or ID. The properties of the view – view column metadata, paginated result records, etc. can then be accessed using an entityview object that will be available within the tag block.

If the view is loaded successfully, the content within the block will be rendered. If the view is not found, the block content will not be rendered.

{% entityview logical_name:'contact', name:"Active Contacts" %}
Loaded entity view with {{ entityview.total_records }} total records.
{% endentityview %}

By default, the entityview object will be given the variable name entityview. Optionally, a different variable name can be provided.

{% entityview my_view = logical_name:'contact', name:"Active Contacts" %}
Loaded entity view with {{ my_view.total_records }} total records.
{% endentityview %}

If entityview is nested within an entitylist block, it will inherit its default configuration (result page size, filter options, etc.) from the entity list. If no view id or name parameters are provided to entityview, it will load the default view from the enclosing entitylist.

{% entitylist id:page.adx_entitylist.id %}
{% entityview %}
Loaded default view of the entity list associated with the current page, with {{ entityview.total_records }} total records.
{% endentityview %}
{% endentitylist %}

Provide either id or logical_name with name to select the CRM view to load. If neither is provided, and the entityview tag is nested within an entitylist tag, the default view of the enclosing entitylist will be loaded.

id must be a string that can be parsed as a GUID.

{% entityview id:"936DA01F-9ABD-4d9d-80C7-02AF85C822A8" %}
Loaded entity view {{ entityview.name }}.
{% endentityview %}

Generally, literal GUID strings will not be used. Instead, id will be specified using a GUID property of another variable.

{% entityview id:request.params.view %}
Loaded entity view {{ entityview.name }} using "view" query string request parameter.
{% endentityview %}

The CRM entity logical name of the view to be loaded. Must be used in combination with name.

{% entityview logical_name:'contact', name:"Active Contacts" %}
Loaded entity view with {{ entityview.total_records }} total records.
{% endentityview %}

The CRM name of the view to be loaded. Must be used in combination with logical_name.

{% entityview logical_name:'contact', name:"Active Contacts" %}
Loaded entity view with {{ entityview.total_records }} total records.
{% endentityview %}

Specifies whether to filter the view results by user or account. Must have a string value of "user" or "account".

{% entityview id:request.params.view, filter:'user' %}
Loaded entity view with {{ entityview.total_records }} total records.
{% endentityview %}

A common use case is to set this parameter based on a query string parameter of the current HTTP request.

{% entityview id:request.params.view, filter:request.params.filter %}
Loaded entity view with {{ entityview.total_records }} total records.
{% endentityview %}

Specifies the Entity List metadata filter expression by which to filter view results. This parameter is only valid when entityview is used in combination with entitylist. In most cases, this parameter is set based on a query string parameter of the current HTTP request.

{% entitylist id:page.adx_entitylist.id %}
{% entityview id:request.params.view, metafilter:request.params.mf %}
Loaded entity view with {{ entityview.total_records }} total records.
{% endentityview %}
{% endentitylist %}

Specifies a sort expression for ordering view results. A sort expression can contain one or more entity attribute logical names, followed by a sort direction of either ASC or DESC.

{% entityview id:request.params.view, order:'name ASC, createdon DESC' %}
Loaded entity view with {{ entityview.total_records }} total records.
{% endentityview %}

A common use case is to set this parameter based on a query string parameter of the current HTTP request.

{% entityview id:request.params.view, order:request.params.order %}
Loaded entity view with {{ entityview.total_records }} total records.
{% endentityview %}

Specifies the view result page to load. If this parameter is not specified, the first page of results will be loaded.

This parameter must be passed either an integer value, or a string that can be parsed as an integer. If a value is provided for this parameter, but the value is null or otherwise cannot be parsed as an integer, the first page of results will be loaded.

{% entityview id:request.params.view, page:2 %}
Loaded page {{ entityview.page }} of entity view with {{ entityview.total_records }} total records.
{% endentityview %}

A common use case is to set this parameter based on a query string parameter of the current HTTP request.

{% entityview id:request.params.view, page:request.params.page %}
Loaded page {{ entityview.page }} of entity view with {{ entityview.total_records }} total records.
{% endentityview %}

Specifies the number of results to load for the current result page. If no value is provided for this parameter, and entityview is used within an entitylist block, the entity list page size will be used. If not within an entitylist block, a default value of 10 will be used.

This parameter must be passed either an integer value, or a string that can be parsed as an integer. If a value is provided for this parameter, but the value is null or otherwise cannot be parsed as an integer, the default page size will be used.

{% entityview id:request.params.view, page_size:20 %}
Loaded entity view with {{ entityview.total_records }} total records.
{% endentityview %}

A common use case is to set this parameter based on a query string parameter of the current HTTP request.

{% entityview id:request.params.view, page_size:request.params.pagesize %}
Loaded entity view with {{ entityview.total_records }} total records.
{% endentityview %}

Specifies a search expression by which to filter view results. Simple keyword search expressions will filter by whether attributes begin with the keyword. Wildcards * can also be included in the expression.

{% entityview id:request.params.view, search:'John*' %}
Loaded entity view with {{ entityview.total_records }} total matching records.
{% endentityview %}

A common use case is to set this parameter based on a query string parameter of the current HTTP request, so that the search filter can be set based on user input.

{% entityview id:request.params.view, search:request.params.search %}
Loaded entity view with {{ entityview.total_records }} total matching records.
{% endentityview %}

Specifies whether to apply Entity Permission filtering on view results. This parameter is set to false by default. If entityview is used within an entitylist block, the value of this parameter will be inherited from the entity list configuration.

This parameter must be passed either an boolean value, or a string that can be parsed as a boolean ("true", "false"). If a value is provided for this parameter, but the value is null or otherwise cannot be parsed as a boolean, the default of false will be used.

{% entityview id:request.params.view, enable_entity_permissions:true %}
Loaded entity view with {{ entityview.total_records }} total records to which the user has read permission.
{% endentityview %}

A CRM integer language code to select the entity view localized labels (column header labels, etc.) to be loaded. If no language_code is provided, the default language of the portal application CRM connection will be used.

If entityview is used within an entitylist block, entityview will inherit its language code configuration from entitylist.

{% entityview logical_name:'contact', name:"Active Contacts", language_code:1033 %}
Loaded entity view {{ entityview.name }}.
{% endentitylist %}

searchindex Added 7.0.0011

Performs a query against the portal search index. The matching results can then be accessed using a searchindex object that will be available within the tag block.

{% searchindex query: 'support', page: params.page, page_size: 10 %}
{% if searchindex.results.size > 0 %}
<p>Found about {{ searchindex.approximate_total_hits }} matches:</p>
<ul>
{% for result in searchindex.results %}
<li>
<h3><a href="{{ result.url | escape }}">{{ result.title | escape }}</a></h3>
<p>{{ result.fragment }}</p>
</li>
{% endfor %}
</ul>
{% else %}
<p>Your query returned no results.</p>
{% endif %}
{% endsearchindex %}

By default, the search index object will be given the variable name searchindex. Optionally, a different variable name can be provided.

{% searchindex liquid_search = query: 'support', page: params.page, page_size: 10 %}
{% if liquid_search.results.size > 0 %}
...
{% endif %}
{% endsearchindex %}

The searchindex tag accepts the following parameters.

The query used to match results. This parameter is intended to accept the user-specified part of the index query (if any).

{% searchindex query: 'support' %}
...
{% endsearchindex %}

A common use case is to set this parameter based on a query string parameter of the current HTTP request.

{% searchindex query: request.params.query %}
...
{% endsearchindex %}

This parameter supports the Lucene Query Parser syntax.

An additional query used to match results. This parameter is intended to accept a developer-specified filter for results, if desired.

{% searchindex query: request.params.query, filter: '+statecode:0' %}
...
{% endsearchindex %}

This parameter supports the Lucene Query Parser syntax.

The difference between filter and query is that while both will accept the Lucene Query Parser syntax, query is intended to be more forgiving about how this syntax is parsed – as it's expected that most end users will not be aware of this syntax.

So, in the case that parsing query according to this syntax fails, the entire query will be escaped and submitted as the query text. filter, on the other hand, will be parsed strictly and return an error if the case of invalid syntax.

The CRM entity logical names to which matching results will be restricted, as a comma-delimited string. If not provided, all matching entities will be returned.

{% searchindex query: request.params.query, logical_names: 'kbarticle,incident' %}
...
{% endsearchindex %}

The search result page to be returned. If not provided, the first page (1) will be returned.

{% searchindex query: request.params.query, page: 2 %}
...
{% endsearchindex %}

A common use case is to set this parameter based on a query string parameter of the current HTTP request.

{% searchindex query: request.params.query, page: request.params.page %}
...
{% endsearchindex %}

The size of the result page to be returned. If not provided, a default size of 10 will be used.

{% searchindex query: request.params.query, page_size: 20 %}
...
{% endsearchindex %}

Specifies the name of the configured search provider to use. If not specified, the default search provider will be used.

Having multiple search providers is an advanced configuration that will not apply to most environments. Generally, it will not be necessary to specify this parameter.

{% searchindex query: request.params.query, provider: 'AlternateIndex' %}
...
{% endsearchindex %}

entityform Added 7.0.0015

Fully renders a CRM-configured Entity Form, by name or ID.

The entityform tag is only available for use in content rendered inside a Web Template-based Page Template. Attempting to use the tag inside a Rewrite-based Page Template will not render anything.

You may only render a single entityform or webform tag per page. entityform or webform tags after the first will not be rendered.

{% entityform name: 'My Entity Form' %}

The name of the Entity Form you wish to load.

{% entityform name:"My Entity Form" %}

webform Added 7.0.0015

Fully renders a CRM-configured Web Form, by name or ID.

The webform tag is only available for use in content rendered inside a Web Template-based Page Template. Attempting to use the tag inside a Rewrite-based Page Template will not render anything.

You may only render a single entityform or webform tag per page. entityform or webform tags after the first will not be rendered.

{% webform name: 'My Web Form' %}

The name of the Web Form you wish to load.

{% webform name:"My Web Form" %}