Change log

module (Event)

This module component fetches data relating to Events.

{% component type: "module", source: "Event", 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
Event (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.

While this parameter is required to render your Layout markup, if the parameter is blank, has an incorrectly referenced Layout, or is removed altogether then the component will still output the modules item data to a Liquid collection which can be accessed via the collectionVariable parameter.

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.
ignoreWeighting
false (default)
true

Enables/disables sorting items first by their weighting values. When false items will sort by their weighting values first, followed by any sortBy properties (or the default alpha/numeric sorting if sortBy is empty or not present). If true item weightings will be ignored and sorting will only be applied via sortBy or default sorting.
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 (Events), but is otherwise the default structure you will get from this Component.

{
  "Pagination": {
  "CurrentPage": 1,
  "ItemsPerPage": 10,
  "NumberOfPages": 1,
  "TotalItemsCount": 4
},
  "Items": [
  {
    "Id": 2587,
    "Url": "/event/demo-event-1-no-group",
    "ParentId": 2335,
    "LastUpdatedDate": "2020-08-19T18:28:06",
    "Name": "DEMO Event 1 No Group",
    "UrlSlug": "demo-event-1-no-group",
    "Enabled": true,
    "ReleaseDate": "2020-08-19T00:00:00",
    "ExpiryDate": "2099-12-11T13:00:00",
    "Weighting": 0,
    "Description": "",
    "ItemTags": null,
    "Author_Name": null,
    "Author_Url": null,
    "Author": "",
    "SEOTitle": "",
    "MetaTitle": "",
    "MetaDescription": "",
    "ShowPageForSearchEngine": false,
    "CanonicalLink": "",
    "EnableAMP": false,
    "AMPContent": "",
    "CodeEditor": false,
    "ExternalId": 0,
    "SocialMetaTags": "",
    "OpenGraphProperties": "",
    "DisableForSiteSearch": false,
    "SeoPriority": "0.5",
    "CreatedByMemberId": 0,
    "ItemCategories": null,
    "ItemCategoryIdList": null,
    "SKUCode": "97d7d40c-67ec-4eac-b78d-e2aad80d2558",
    "SiteSearchKeywords": "",
    "Capacity": 0,
    "Price": 0.0,
    "Allocation": 0,
    "HideWhenFull": false,
    "AllowMultipleSubscriptionPerEmail": false,
    "EventDateStart": "2020-08-21T09:25:00",
    "EventDateEnd": "2044-08-21T23:59:00",
    "Module_ID": 2330,
    "Module_Alias": "Event",
    "taxRate": 0.0,
    "IsHide": false,
    "InStock": 0,
    "IsDisable": false,
    "priceWithTax": 0.0,
    "ProductDataJSON": {
      "itemId": 2587,
      "attributes": {},
      "variations": null,
      "options": {},
      "inStockTotal": null,
      "recommendedPrice": null,
      "prices": {
        "0": 0.0
      },
      "taxInPercent": 0.0,
      "taxRate": 0.0,
      "enablePreOrder": true,
      "maximumUnits": 0,
      "minimumUnits": 0,
      "QuantityThreshold": [
        {
          "Quantity": 0,
          "Price": 0.0
        }
      ]
    },
    "RecommendedPrice": 0.0,
    "RecommendedPriceWithTax": 0.0,
    "EnableInventoryControl": false,
    "VolumeDiscount": [
      {
        "Quantity": 0,
        "Price": 0.0
      }
    ],
    "PriceHtml": "<span data-cms_product_data_price=\"2587\">0.00</span>",
    "InStockHtml": "<span data-cms_product_data_in_stock=\"2587\">0</span>",
    "priceWithTaxHtml": "<span data-cms_product_data_price_with_tax=\"2587\">0.00</span>",
    "RecommendedPriceHtml": "<span data-cms_product_data_recommended_price=\"2587\">0.00</span>",
    "RecommendedPriceWithTaxHtml": "<span data-cms_product_data_recommended_price_with_tax=\"2587\">0.00</span>",
    "InventoryProductVariations": [
      {
        "SKUCode": "97d7d40c-67ec-4eac-b78d-e2aad80d2558",
        "InStock": 0,
        "PreOrder": 0
      }
    ],
    "ProductDataJsonHTML": "<script>initEcommerceProductPriceVariations(2587,{\"itemId\":2587,\"attributes\":{},\"variations\":null,\"options\":{},\"inStockTotal\":null,\"recommendedPrice\":null,\"prices\":{\"0\":0.0},\"taxInPercent\":0.0,\"taxRate\":0.0,\"enablePreOrder\":true,\"maximumUnits\":0,\"minimumUnits\":0,\"QuantityThreshold\":[{\"Quantity\":0,\"Price\":0.0}]});</script>",
    "IsGroupedProduct": false
  },
  {
    "Id": 2505,
    "Url": "/event/demo-event-group-1/sample-event-one",
    "ParentId": 2503,
    "LastUpdatedDate": "2020-04-16T12:29:54",
    "Name": "Sample Event One",
    "UrlSlug": "sample-event-one",
    "Enabled": true,
    "ReleaseDate": "2020-02-12T01:30:00",
    "ExpiryDate": "2099-12-11T13:00:00",
    "Weighting": 0,
    "Description": "<p>This is the event of the year!</p>",
    "ItemTags": null,
    "Author_Name": null,
    "Author_Url": null,
    "Author": "",
    "SEOTitle": "",
    "MetaTitle": "",
    "MetaDescription": "",
    "ShowPageForSearchEngine": false,
    "CanonicalLink": "",
    "EnableAMP": false,
    "AMPContent": "",
    "CodeEditor": false,
    "ExternalId": 0,
    "SocialMetaTags": "",
    "OpenGraphProperties": "",
    "DisableForSiteSearch": false,
    "SeoPriority": "0.5",
    "CreatedByMemberId": 0,
    "ItemCategories": null,
    "ItemCategoryIdList": null,
    "SKUCode": "06871a94-e2fc-4c74-a3cf-6aabb92f9001",
    "SiteSearchKeywords": "",
    "Capacity": 0,
    "Price": 0.0,
    "Allocation": 0,
    "HideWhenFull": false,
    "AllowMultipleSubscriptionPerEmail": false,
    "EventDateStart": "2020-02-12T20:00:00",
    "EventDateEnd": "2020-02-12T23:59:00",
    "Module_ID": 2330,
    "Module_Alias": "Event",
    "taxRate": 0.0,
    "IsHide": false,
    "InStock": 0,
    "IsDisable": false,
    "priceWithTax": 0.0,
    "ProductDataJSON": {
      "itemId": 2505,
      "attributes": {},
      "variations": null,
      "options": {},
      "inStockTotal": null,
      "recommendedPrice": null,
      "prices": {
        "0": 0.0
      },
      "taxInPercent": 0.0,
      "taxRate": 0.0,
      "enablePreOrder": true,
      "maximumUnits": 0,
      "minimumUnits": 0,
      "QuantityThreshold": [
        {
          "Quantity": 0,
          "Price": 0.0
        }
      ]
    },
    "RecommendedPrice": 0.0,
    "RecommendedPriceWithTax": 0.0,
    "EnableInventoryControl": false,
    "VolumeDiscount": [
      {
        "Quantity": 0,
        "Price": 0.0
      }
    ],
    "PriceHtml": "<span data-cms_product_data_price=\"2505\">0.00</span>",
    "InStockHtml": "<span data-cms_product_data_in_stock=\"2505\">0</span>",
    "priceWithTaxHtml": "<span data-cms_product_data_price_with_tax=\"2505\">0.00</span>",
    "RecommendedPriceHtml": "<span data-cms_product_data_recommended_price=\"2505\">0.00</span>",
    "RecommendedPriceWithTaxHtml": "<span data-cms_product_data_recommended_price_with_tax=\"2505\">0.00</span>",
    "InventoryProductVariations": [
      {
        "SKUCode": "06871a94-e2fc-4c74-a3cf-6aabb92f9001",
        "InStock": 0,
        "PreOrder": 0
      }
    ],
    "ProductDataJsonHTML": "<script>initEcommerceProductPriceVariations(2505,{\"itemId\":2505,\"attributes\":{},\"variations\":null,\"options\":{},\"inStockTotal\":null,\"recommendedPrice\":null,\"prices\":{\"0\":0.0},\"taxInPercent\":0.0,\"taxRate\":0.0,\"enablePreOrder\":true,\"maximumUnits\":0,\"minimumUnits\":0,\"QuantityThreshold\":[{\"Quantity\":0,\"Price\":0.0}]});</script>",
    "IsGroupedProduct": false
  },
  {
    "Id": 2507,
    "Url": "/event/demo-event-group-2/sample-event-three",
    "ParentId": 2504,
    "LastUpdatedDate": "2020-04-16T12:29:58",
    "Name": "Sample Event Three",
    "UrlSlug": "sample-event-three",
    "Enabled": true,
    "ReleaseDate": "2020-02-12T00:00:00",
    "ExpiryDate": "2099-12-11T13:00:00",
    "Weighting": 0,
    "Description": "",
    "ItemTags": null,
    "Author_Name": null,
    "Author_Url": null,
    "Author": "",
    "SEOTitle": "",
    "MetaTitle": "",
    "MetaDescription": "",
    "ShowPageForSearchEngine": false,
    "CanonicalLink": "",
    "EnableAMP": false,
    "AMPContent": "",
    "CodeEditor": false,
    "ExternalId": 0,
    "SocialMetaTags": "",
    "OpenGraphProperties": "",
    "DisableForSiteSearch": false,
    "SeoPriority": "0.5",
    "CreatedByMemberId": 0,
    "ItemCategories": null,
    "ItemCategoryIdList": null,
    "SKUCode": "517a6f72-a736-4d84-be7d-7833a85fb4a0",
    "SiteSearchKeywords": "",
    "Capacity": 50,
    "Price": 0.0,
    "Allocation": 0,
    "HideWhenFull": false,
    "AllowMultipleSubscriptionPerEmail": true,
    "EventDateStart": "2020-02-05T12:00:00",
    "EventDateEnd": "2020-02-05T18:30:00",
    "Module_ID": 2330,
    "Module_Alias": "Event",
    "taxRate": 0.0,
    "IsHide": false,
    "InStock": 0,
    "IsDisable": false,
    "priceWithTax": 0.0,
    "ProductDataJSON": {
      "itemId": 2507,
      "attributes": {},
      "variations": null,
      "options": {},
      "inStockTotal": null,
      "recommendedPrice": null,
      "prices": {
        "0": 0.0
      },
      "taxInPercent": 0.0,
      "taxRate": 0.0,
      "enablePreOrder": true,
      "maximumUnits": 0,
      "minimumUnits": 0,
      "QuantityThreshold": [
        {
          "Quantity": 0,
          "Price": 0.0
        }
      ]
    },
    "RecommendedPrice": 0.0,
    "RecommendedPriceWithTax": 0.0,
    "EnableInventoryControl": false,
    "VolumeDiscount": [
      {
        "Quantity": 0,
        "Price": 0.0
      }
    ],
    "PriceHtml": "<span data-cms_product_data_price=\"2507\">0.00</span>",
    "InStockHtml": "<span data-cms_product_data_in_stock=\"2507\">0</span>",
    "priceWithTaxHtml": "<span data-cms_product_data_price_with_tax=\"2507\">0.00</span>",
    "RecommendedPriceHtml": "<span data-cms_product_data_recommended_price=\"2507\">0.00</span>",
    "RecommendedPriceWithTaxHtml": "<span data-cms_product_data_recommended_price_with_tax=\"2507\">0.00</span>",
    "InventoryProductVariations": [
      {
        "SKUCode": "517a6f72-a736-4d84-be7d-7833a85fb4a0",
        "InStock": 0,
        "PreOrder": 0
      }
    ],
    "ProductDataJsonHTML": "<script>initEcommerceProductPriceVariations(2507,{\"itemId\":2507,\"attributes\":{},\"variations\":null,\"options\":{},\"inStockTotal\":null,\"recommendedPrice\":null,\"prices\":{\"0\":0.0},\"taxInPercent\":0.0,\"taxRate\":0.0,\"enablePreOrder\":true,\"maximumUnits\":0,\"minimumUnits\":0,\"QuantityThreshold\":[{\"Quantity\":0,\"Price\":0.0}]});</script>",
    "IsGroupedProduct": false
  },
  {
    "Id": 2506,
    "Url": "/event/demo-event-group-1/sample-event-two",
    "ParentId": 2503,
    "LastUpdatedDate": "2020-04-16T12:29:54",
    "Name": "Sample Event Two",
    "UrlSlug": "sample-event-two",
    "Enabled": true,
    "ReleaseDate": "2020-02-12T00:00:00",
    "ExpiryDate": "2099-12-11T13:00:00",
    "Weighting": 0,
    "Description": "<p>The longest event in history...</p>",
    "ItemTags": null,
    "Author_Name": null,
    "Author_Url": null,
    "Author": "",
    "SEOTitle": "",
    "MetaTitle": "",
    "MetaDescription": "",
    "ShowPageForSearchEngine": false,
    "CanonicalLink": "",
    "EnableAMP": false,
    "AMPContent": "",
    "CodeEditor": false,
    "ExternalId": 0,
    "SocialMetaTags": "",
    "OpenGraphProperties": "",
    "DisableForSiteSearch": false,
    "SeoPriority": "0.5",
    "CreatedByMemberId": 0,
    "ItemCategories": null,
    "ItemCategoryIdList": null,
    "SKUCode": "edc7c49d-1077-4f75-8ac7-23bd545d12b1",
    "SiteSearchKeywords": "",
    "Capacity": 100,
    "Price": 0.0,
    "Allocation": 0,
    "HideWhenFull": false,
    "AllowMultipleSubscriptionPerEmail": false,
    "EventDateStart": "2020-02-11T15:15:00",
    "EventDateEnd": "2020-04-25T18:30:00",
    "Module_ID": 2330,
    "Module_Alias": "Event",
    "taxRate": 0.0,
    "IsHide": false,
    "InStock": 0,
    "IsDisable": false,
    "priceWithTax": 0.0,
    "ProductDataJSON": {
      "itemId": 2506,
      "attributes": {},
      "variations": null,
      "options": {},
      "inStockTotal": null,
      "recommendedPrice": null,
      "prices": {
        "0": 0.0
      },
      "taxInPercent": 0.0,
      "taxRate": 0.0,
      "enablePreOrder": true,
      "maximumUnits": 0,
      "minimumUnits": 0,
      "QuantityThreshold": [
        {
          "Quantity": 0,
          "Price": 0.0
        }
      ]
    },
    "RecommendedPrice": 0.0,
    "RecommendedPriceWithTax": 0.0,
    "EnableInventoryControl": false,
    "VolumeDiscount": [
      {
        "Quantity": 0,
        "Price": 0.0
      }
    ],
    "PriceHtml": "<span data-cms_product_data_price=\"2506\">0.00</span>",
    "InStockHtml": "<span data-cms_product_data_in_stock=\"2506\">0</span>",
    "priceWithTaxHtml": "<span data-cms_product_data_price_with_tax=\"2506\">0.00</span>",
    "RecommendedPriceHtml": "<span data-cms_product_data_recommended_price=\"2506\">0.00</span>",
    "RecommendedPriceWithTaxHtml": "<span data-cms_product_data_recommended_price_with_tax=\"2506\">0.00</span>",
    "InventoryProductVariations": [
      {
        "SKUCode": "edc7c49d-1077-4f75-8ac7-23bd545d12b1",
        "InStock": 0,
        "PreOrder": 0
      }
    ],
    "ProductDataJsonHTML": "<script>initEcommerceProductPriceVariations(2506,{\"itemId\":2506,\"attributes\":{},\"variations\":null,\"options\":{},\"inStockTotal\":null,\"recommendedPrice\":null,\"prices\":{\"0\":0.0},\"taxInPercent\":0.0,\"taxRate\":0.0,\"enablePreOrder\":true,\"maximumUnits\":0,\"minimumUnits\":0,\"QuantityThreshold\":[{\"Quantity\":0,\"Price\":0.0}]});</script>",
    "IsGroupedProduct": false
  }
],
  "Params": {
  "source": "Event",
  "layout": "",
  "type": "module",
  "collectionVariable": "allEvents"
},
  "Parent": {
  "Id": 2354,
  "Url": "/component-types/module-event",
  "ParentId": 2127,
  "LastUpdatedDate": "2020-10-27T05:35:39",
  "Name": "module (Event)",
  "UrlSlug": "module-event",
  "Enabled": true,
  "ReleaseDate": "2018-09-04T00:00:00",
  "ExpiryDate": "2099-12-09T00:00:00",
  "Weighting": 964,
  "Description": "<p>This module component fetches data relating to Events.</p>\r\n\r\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{data}}\", lang: \"liquid\" %}\r\n\r\n\r\n{% component type: \"snippet\", alias: \"section_parameters\" %}\r\n\r\n{% component type: \"json\", source_type:\"string\", source:\"{{tabularData}}\", layout:\"/snippets/tabularJSON.layout\" %}\r\n</section>\r\n\r\n{% component type: \"snippet\", alias: \"section_output\" %}\r\n\r\n{% component source: \"Event\", layout: "", type: \"module\", collectionVariable: \"allEvents\" %}\r\n<p>The below example has 4 sample <code>items</code> (Events), but is otherwise the default structure you will get from this Component.</p>\r\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{allEvents}}\", lang: \"json\" %}\r\n</section>\r\n\r\n{% component type: \"snippet\", alias: \"section_accessing_data\" %}\r\n\r\n<p>This data is accessible in two main ways:</p>\r\n\r\n<p>1. Using Liquid in the specified Layout via the <code>this</code> object.</p>\r\n\r\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{data}}\", lang: \"liquid\" %}\r\n\r\n<p>2. Directly on the Page or Template via a Liquid Collection if <code>collectionVariable</code> was added to the Component tag.</p>\r\n\r\n<p>An example using <code>collectionVariable</code> with value \"allEvents\" to list all \"Events\" across the site:</p>\r\n<p class=\"notice-note\">Here we suppress any Layout from rendering by setting <code>layout: \"\"</code> as an empty attribute.</p>\r\n\r\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{data}}\", lang: \"liquid\" %}\r\n\r\n<p><em>Looping through the collection to render all the item URLs in a list, giving us:</em></p>\r\n\r\n<ul>\r\n    \r\n        <li>/event/demo-event-1-no-group</li>\r\n    \r\n        <li>/event/demo-event-group-1/sample-event-one</li>\r\n    \r\n        <li>/event/demo-event-group-2/sample-event-three</li>\r\n    \r\n        <li>/event/demo-event-group-1/sample-event-two</li>\r\n    \r\n</ul>\r\n<br>\r\n<p><em>The code:</em></p>\r\n\r\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{data}}\", lang: \"liquid\" %}\r\n\r\n<p><em>Accessing a specific item within the collection. In this case the second item (zero based index), which in our example would render the value <code>/event/demo-event-group-1/sample-event-one</code></em></p>\r\n\r\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{data}}\", lang: \"liquid\" %}\r\n\r\n\r\n<section id=\"secListFilteredEvents\">\r\n    <h3>List Events from a specific Event group</h3>\r\n<p>If you have more than one Event group on your site the above examples will list Events from all Event groups as one single collection. However, typically you'd want to list all Events from only the Event group they belong to (their \"parent\" Event group).</p>\r\n<p>To do this we add the <code>filterBy</code> and <code>filterValue</code> attributes to the Component tag.</p>\r\n<p>Typically, you would be listing Event group specific Events on your Event group detail page/index page. In which case you would be editing the 'General Event group Layout' to insert your Component tag, which would look like this:</p>\r\n\r\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{data}}\", lang: \"liquid\" %}\r\n\r\n<p>As we are within the Event group's detail Layout (which represents the 'parent' Event group) we can reference its ID for the filter value using <code>{{this['id']}}</code> and instruct the Component tag to filter the Events only by their parent (<code>filterBy: \"parentID\"</code>) - giving us only the relevant Events for the current Event group.</p>\r\n<p>You may however, want to render a list of Events on a standard page or within another modules layout,  where the Post's parent ID (the Event group 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 Event group's ID into the component tag in place of the above Liquid generated ID (<code>filterValue: \"1234\"</code>).</p>\r\n<p class=\"notice-tip\">To obtain the Event group's ID from the admin, go to that Event group's list view (where you can see all of the Events) and note the number in the URL address bar shown after the <code>parentID=</code> parameter.</p>\r\n</section>\r\n</section>\r\n\r\n{% component type: \"snippet\", alias: \"section_event_calendar\" %}\r\n</section>\r\n\r\n{% component type: \"snippet\", alias: \"section_counter\" %}\r\n</section>\r\n",
  "ItemTags": [
  "Events"
],
  "Author_Name": "",
  "Author_Url": "",
  "Author": "",
  "SEOTitle": "",
  "MetaTitle": "",
  "MetaDescription": "",
  "ShowPageForSearchEngine": true,
  "CanonicalLink": "",
  "EnableAMP": false,
  "AMPContent": "",
  "CodeEditor": true,
  "ExternalId": 0,
  "SocialMetaTags": "",
  "OpenGraphProperties": {
  "title": null,
  "type": null,
  "url": null,
  "locale": null,
  "image": null
},
  "DisableForSiteSearch": false,
  "SeoPriority": "",
  "CreatedByMemberId": 0,
  "ItemCategories": "",
  "ItemCategoryIdList": "",
  "SKUCode": "",
  "SiteSearchKeywords": "",
  "Active": true,
  "IgnoreUpdates": false,
  "UpdateNotes": "",
  "UpdatesLog": "<ul><li>27-Oct-2020 | 5.6.0 | Added 'ignoreWeighting' parameter</li><li>'module_of_member' parameter details added.</li></ul>",
  "ExternalResources": "",
  "AdditionalRelatedArticle_Name": "",
  "AdditionalRelatedArticle_Url": "",
  "AdditionalRelatedArticle": "",
  "AdditionalRelatedArticle2_Name": "",
  "AdditionalRelatedArticle2_Url": "",
  "AdditionalRelatedArticle2": "",
  "Authors": "2418",
  "Module_ID": 1870,
  "Module_Alias": "DocumentationPost",
  "ParentName": "Liquid Components",
  "ParentUrl": "/component-types",
  "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 "allEvents" to list all "Events" across the site:

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

{% component type: "module", source: "Event", layout: "", collectionVariable: "allEvents" %}

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

  • /event/demo-event-1-no-group
  • /event/demo-event-group-1/sample-event-one
  • /event/demo-event-group-2/sample-event-three
  • /event/demo-event-group-1/sample-event-two

The code:

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

Accessing a specific item within the collection. In this case the second item (zero based index), which in our example would render the value /event/demo-event-group-1/sample-event-one

{{allEvents.items[1]['url']}}

List Events from a specific Event group

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

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

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

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

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

You may however, want to render a list of Events on a standard page or within another modules layout, where the Post's parent ID (the Event group 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 Event group's ID into the component tag in place of the above Liquid generated ID (filterValue: "1234").

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

Event Calendar

Event items can also be listed onto a calendar layout, based on their start and end dates, using the below include.

{% include "/cms-assets/includes/event-calendar.inc", moduleId: "<Event Module ID>" %}

This include can also be generated via the Component Manager, in the Event section, along with some other attributes to further configure the output as detailed below.

Calendar Include Parameters

Parameter
Values
Required
Description
moduleId
<Event Module ID>
The ID of the Event Module (this will be automatically generated for you via the Component Manager).
group
0 (default)
-1
<Event Group ID>

The ID of the Event Module Group/parent module. Or 0 to retrieve all Event items from all groups. Or -1 to retrieve all ungrouped Event items.
category
<Category Name/Sub Category Name/>

Name of the category to filter Event items by. Or the hierarchical category structure if using sub categories.

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.



Related Articles

  • Event Bookings
  • module (Event Group)
    This module component fetches data relating to Event groups. {% capture data %} {% raw...
  • Advanced CRM Groups
  • Events
    Events can be used for listing and taking paid or free bookings for date/time specific events as well as tracking capacity and multiply seat purchases.

External Resources

There are currently no external resources available.

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.
Visit the Treepl Forum for community support and to search previously asked questions or send us a message at support@treepl.co and we will consult you as soon as possible.