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.
These Fields are available to all standard modules:
<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>
`
`
id
- the Module's ID
item_ids
- output one or more module items, comma separated
category_ids
- output all items in one or more categories, comma separated
layout
- 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 page
show_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 ordered
properties.name
- name of the Module item (alphabetical)
created_at
- date the Module item was created
updated_at
- date the Module item was last edited
properties.weighting
- weighting of the Module item
properties.release_date
- date the item is set to be released
properties.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 order
collection
- 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 URL
use_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'
.
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'
.
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