đģReference
In this section, we'll add reference code which is relevant across Modules. Specific Modules may have further relevant reference material in their own sections of the docs.
Standard Module Fields
These Fields are available to all standard modules:
Field Name | Liquid Tag | Description |
Item Name | {{ this['name'] }} | name of the Blog Post |
Item Slug | {{ this['slug'] }} | item URL |
Weighting | {{ this['weighting'] }} | weight of item, used for sorting |
Release Date | {{ this['release_date'] }} | release date of the item |
Expiry Date | {{ this['expiry_date'] }} | expiry date of the item |
Enabled | {{ this['enabled'] }} | enable/disable the item |
Output a Module Layout
List Layouts
<div data-gb-custom-block data-tag="-" data-0='module' data-1=', id: ' data-2='3' data-3='3' data-4='default' data-5='default' data-6='1' data-7='1' data-8='1' data-9='1' data-10='1' data-11='1' data-12='1' data-13='properties.release_date' data-14=', sort_order: ' data-15='asc' data-16='asc'></div>
Detail Layouts
`
`
Liquid Include Parameters
id
- the Module's IDitem_ids
- output one or more module items, comma separatedcategory_ids
- output all items in one or more categories, comma separatedlayout
- default is /default/ - 'layout' values are relative to the folder: layouts/modules/Blog (module_3)/[layout name]per_page
- defines the number of items outputted on the pageshow_pagination
- default is true - defines if items should be paginated when the per_page is met.sort_type
- defines the type by which items are orderedproperties.name
- name of the Module item (alphabetical)created_at
- date the Module item was createdupdated_at
- date the Module item was last editedproperties.weighting
- weighting of the Module itemproperties.release_date
- date the item is set to be releasedproperties.module_field_3_1
- Sort by a core or custom field
sort_order
- defines the order in which the type is sorted asc - sort items in ascending order desc - sort items in descending ordercollection
- default is 'false' - If you set it as collection: 'true' then any layout is suppressed.Data is accessible via {{context.exports.webapp_1.data}}. For Example, name would be: {{context.exports.webapp_1.data.result.items[0]['name']}}use_search
- Allows the Module to be searched by keyword parameter in URLuse_adv_search
- Allows the Module to be filtered by core/custom field IDs in URL parameters
If you nest any more Module or WebApp layouts inside this Module Layout, they will inherit the type parameter. This means if you want to input a nested list layout, you may need to reset the type parameter back to list with type: 'list'
.
Output the Most Recent Item
To get the most recently "released" item, you can use the sort_type
parameter to sort by properties.release_date
. You can alternatively use created_at
to sort by the Item you most recently added to the Admin.
`
`
Then just output one post- to get the first Item. To do this, set per_page
to 1
.
Use the sort_order
to control whether you get the first or last item. To get the latest Item by date, the date will have a higher value, so use 'desc'
(starts with highest number) rather then 'asc'
.
Last updated