Skip to documentation content

List methods

List methods

Object list shortcut methods and search that return collections.

{% articles %}

{% articles output_to_template? [[var, set, or assign]? variable]? output_to_template? = arguments %}
Parameters
output_to_template optionalflag
If included the {% articles %} will be output directly to the template.
var, set, or assign optionalkeyword
Optional. Specify either "var", "set" or "assign" to change which scope this {% articles %} is stored on. "var" is the default behavior.
variable optionalvariable
arguments requiredcollection
Key:value pairs. May use the variable arguments syntax.

Options

prepend optionallist
May be a single article, a list of articles, or the name or guid of one article, to be included at the beginning of the articles list.
append optionallist
May be a single article, a list of articles, or the name or guid of one article, to be included at the end of the articles list.
exclude optionallist
May be a single article, a list of articles, or the name or guid of one article that should NOT be included in the fetched results. Has no effect on prepended or appended articles.
exclude_prepended optionalboolean
True to specifically exclude all prepended articles from the fetched results. If "unique:true" is specified this is the default behavior, although you may also specify "exclude_prepended:false" to allow any prepended items to be fetched along with other results anyway.
exclude_appended optionalboolean
True to specifically exclude all appended articles from the fetched results. This is false by default - even if "unique:true" is specified - so that results are returned in the proper order.
unique optionalboolean
True to remove duplicates from each of the resulting lists (prepended, fetched, appended, and items), although there may be duplicates between the prepended, fetched, and appended lists. The "items" list will include objects in the order in which they appear - with prepended items first, then fetched items, then appended items.
max_size optionalinteger
The maximum number of items to be included in the "items" list. If there are any prepended or appended items, this will automatically lower the "limit" to only fetch as many articles as needed. Note that this may also impact both the "page" and "total_pages" values in the resulting articles. In order to use pagination with a list loaded using "max_size" use "start" instead of "page" and "limit".
filter optionalvalue
Only include articles that match the given string filter
start_date optionalvalue
Only include articles with a post_date greater than or equal to start_date
end_date optionalvalue
Only include articles with a post_date less than or equal to end_date
tag optionalvalue
May include multiple tags. Only include articles with one of the given tags
author optionalvalue
May include multiple authors. Only include articles with one of the given authors
folder optionalvalue
May include multiple folders. Only include articles with one of the given folders
date_created_start optionalvalue
Only include articles with date_created greater than or equal to date_created_start. Remember that date_created will typically be the date that the article was first published.
date_created_end optionalvalue
Only include articles with date_created less than or equal to date_created_end. Remember that date_created will typically be the date that the article was first published.
has_url optionalboolean
If true, only return articles that have a URL. If false, only return articles that do NOT have a URL.
template optionalobject
Only return articles with one of these templates. May be a single template, a list of templates, or the name or guid of a template to filter the results by.
include_in_search optionalboolean
True or false to only return articles whose include_in_search property matches the provided value.
domain_name optionalobject
Only return articles from the given domain.
start optionalinteger
Set the 1-based index of the first article to fetch.
page optionalinteger
Used to automatically calculate the first article to fetch based on both the "limit" and the 1-based "page" value. Defaults to 1, but is ignored if "start" is set.
limit optionalinteger
The maximum number of articles to fetch. Defaults to 10. Note that if "max_size" is defined, then "limit" may be automatically lowered even if specified separately.
sort_by optionalstring
Specify which property to sort the results by. Has no effect on prepended or appended articles. By default, results will be sorted by relevance if there is a filter string and date_created desc (newest first) if not. Options include:
  • relevance: only applies when there is a filter string. When sorting by relevance sort_direction is ignored.
  • date_created: the date each article was first published. Unpublishing and republishing one resets date_created to the current date.
  • random: results will be returned in a random order, which prevents the page from being fast-cached. Setting cache_random:true overrides this behavior and allows the page to be fast-cached anyway.
  • name
  • title
  • url
  • browser_title
sort_direction optionalstring
asc or desc.
cache_random optionalboolean
True to allow the results to be cached when sort_by is "random".

Fetches a list of {{ articles }}.

Example Fetching Articles that are tagged "Example" and outputting the article titleFetch articles filtered by tag and output each article title (or other fields).
Liquid
{%- articles var fetchedArticles = tag:"Example" start:1 page:1 limit:25 sort_by:"date_created" -%}
{%- for item in fetchedArticles -%}
	<p>{{item.title}}</p>
{%- endfor -%}

{% authors %}

{% authors output_to_template? [[var, set, or assign]? variable]? output_to_template? = arguments %}
Parameters
output_to_template optionalflag
If included the {% authors %} will be output directly to the template.
var, set, or assign optionalkeyword
Optional. Specify either "var", "set" or "assign" to change which scope this {% authors %} is stored on. "var" is the default behavior.
variable optionalvariable
arguments requiredcollection
Key:value pairs. May use the variable arguments syntax.

Options

prepend optionallist
May be a single author, a list of authors, or the name or guid of one author, to be included at the beginning of the authors list.
append optionallist
May be a single author, a list of authors, or the name or guid of one author, to be included at the end of the authors list.
exclude optionallist
May be a single author, a list of authors, or the name or guid of one author that should NOT be included in the fetched results. Has no effect on prepended or appended authors.
exclude_prepended optionalboolean
True to specifically exclude all prepended authors from the fetched results. If "unique:true" is specified this is the default behavior, although you may also specify "exclude_prepended:false" to allow any prepended items to be fetched along with other results anyway.
exclude_appended optionalboolean
True to specifically exclude all appended authors from the fetched results. This is false by default - even if "unique:true" is specified - so that results are returned in the proper order.
unique optionalboolean
True to remove duplicates from each of the resulting lists (prepended, fetched, appended, and items), although there may be duplicates between the prepended, fetched, and appended lists. The "items" list will include objects in the order in which they appear - with prepended items first, then fetched items, then appended items.
max_size optionalinteger
The maximum number of items to be included in the "items" list. If there are any prepended or appended items, this will automatically lower the "limit" to only fetch as many authors as needed. Note that this may also impact both the "page" and "total_pages" values in the resulting authors. In order to use pagination with a list loaded using "max_size" use "start" instead of "page" and "limit".
filter optionalvalue
Only include authors that match the given string filter
tag optionalvalue
May include multiple tags. Only include authors with one of the given tags
folder optionalvalue
May include multiple folders. Only include authors with one of the given folders
date_created_start optionalvalue
Only include authors with date_created greater than or equal to date_created_start. Remember that date_created will typically be the date that the author was first published.
date_created_end optionalvalue
Only include authors with date_created less than or equal to date_created_end. Remember that date_created will typically be the date that the author was first published.
has_url optionalboolean
If true, only return authors that have a URL. If false, only return authors that do NOT have a URL.
template optionalobject
Only return authors with one of these templates. May be a single template, a list of templates, or the name or guid of a template to filter the results by.
include_in_search optionalboolean
True or false to only return authors whose include_in_search property matches the provided value.
domain_name optionalobject
Only return authors from the given domain.
start optionalinteger
Set the 1-based index of the first author to fetch.
page optionalinteger
Used to automatically calculate the first author to fetch based on both the "limit" and the 1-based "page" value. Defaults to 1, but is ignored if "start" is set.
limit optionalinteger
The maximum number of authors to fetch. Defaults to 10. Note that if "max_size" is defined, then "limit" may be automatically lowered even if specified separately.
sort_by optionalstring
Specify which property to sort the results by. Has no effect on prepended or appended authors. By default, results will be sorted by relevance if there is a filter string and date_created desc (newest first) if not. Options include:
  • relevance: only applies when there is a filter string. When sorting by relevance sort_direction is ignored.
  • date_created: the date each author was first published. Unpublishing and republishing one resets date_created to the current date.
  • random: results will be returned in a random order, which prevents the page from being fast-cached. Setting cache_random:true overrides this behavior and allows the page to be fast-cached anyway.
  • name
  • title
  • url
  • browser_title
sort_direction optionalstring
asc or desc.
cache_random optionalboolean
True to allow the results to be cached when sort_by is "random".

Fetches a list of {{ authors }}.

{% blog_posts %}

{% blog_posts output_to_template? [[var, set, or assign]? variable]? output_to_template? = arguments %}
Parameters
output_to_template optionalflag
If included the {% blog_posts %} will be output directly to the template.
var, set, or assign optionalkeyword
Optional. Specify either "var", "set" or "assign" to change which scope this {% blog_posts %} is stored on. "var" is the default behavior.
variable optionalvariable
arguments requiredcollection
Key:value pairs. May use the variable arguments syntax.

Options

prepend optionallist
May be a single blog_post, a list of blog_posts, or the name or guid of one blog_post, to be included at the beginning of the blog_posts list.
append optionallist
May be a single blog_post, a list of blog_posts, or the name or guid of one blog_post, to be included at the end of the blog_posts list.
exclude optionallist
May be a single blog_post, a list of blog_posts, or the name or guid of one blog_post that should NOT be included in the fetched results. Has no effect on prepended or appended blog_posts.
exclude_prepended optionalboolean
True to specifically exclude all prepended blog_posts from the fetched results. If "unique:true" is specified this is the default behavior, although you may also specify "exclude_prepended:false" to allow any prepended items to be fetched along with other results anyway.
exclude_appended optionalboolean
True to specifically exclude all appended blog_posts from the fetched results. This is false by default - even if "unique:true" is specified - so that results are returned in the proper order.
unique optionalboolean
True to remove duplicates from each of the resulting lists (prepended, fetched, appended, and items), although there may be duplicates between the prepended, fetched, and appended lists. The "items" list will include objects in the order in which they appear - with prepended items first, then fetched items, then appended items.
max_size optionalinteger
The maximum number of items to be included in the "items" list. If there are any prepended or appended items, this will automatically lower the "limit" to only fetch as many blog_posts as needed. Note that this may also impact both the "page" and "total_pages" values in the resulting blog_posts. In order to use pagination with a list loaded using "max_size" use "start" instead of "page" and "limit".
filter optionalvalue
Only include blog posts that match the given string filter
blog optionalvalue
May include multiple blogs. Only include blog posts with one of the given blogs
start_date optionalvalue
Only include blog posts with a post_date greater than or equal to start_date
end_date optionalvalue
Only include blog posts with a post_date less than or equal to end_date
tag optionalvalue
May include multiple tags. Only include blog posts with one of the given tags
author optionalvalue
May include multiple authors. Only include blog posts with one of the given authors
folder optionalvalue
May include multiple folders. Only include blog posts with one of the given folders
date_created_start optionalvalue
Only include blog posts with date_created greater than or equal to date_created_start. Remember that date_created will typically be the date that the blog post was first published.
date_created_end optionalvalue
Only include blog posts with date_created less than or equal to date_created_end. Remember that date_created will typically be the date that the blog post was first published.
has_url optionalboolean
If true, only return blog_posts that have a URL. If false, only return blog_posts that do NOT have a URL.
template optionalobject
Only return blog_posts with one of these templates. May be a single template, a list of templates, or the name or guid of a template to filter the results by.
include_in_search optionalboolean
True or false to only return blog_posts whose include_in_search property matches the provided value.
domain_name optionalobject
Only return blog_posts from the given domain.
start optionalinteger
Set the 1-based index of the first blog_post to fetch.
page optionalinteger
Used to automatically calculate the first blog_post to fetch based on both the "limit" and the 1-based "page" value. Defaults to 1, but is ignored if "start" is set.
limit optionalinteger
The maximum number of blog_posts to fetch. Defaults to 10. Note that if "max_size" is defined, then "limit" may be automatically lowered even if specified separately.
sort_by optionalstring
Specify which property to sort the results by. Has no effect on prepended or appended blog_posts. By default, results will be sorted by relevance if there is a filter string and date_created desc (newest first) if not. Options include:
  • relevance: only applies when there is a filter string. When sorting by relevance sort_direction is ignored.
  • date_created: the date each blog_post was first published. Unpublishing and republishing one resets date_created to the current date.
  • random: results will be returned in a random order, which prevents the page from being fast-cached. Setting cache_random:true overrides this behavior and allows the page to be fast-cached anyway.
  • name
  • title
  • url
  • browser_title
sort_direction optionalstring
asc or desc.
cache_random optionalboolean
True to allow the results to be cached when sort_by is "random".

Fetches a list of {{ blog_posts }}.

Example Getting random items with the rand filterUse the rand filter to pick one or more random items from a list, get random numbers, or build random strings. Assign results to a variable so the same random choice is used everywhere on the page; use prevent_cache: false when you want the page response to be cacheable.

One random item from an existing list (prevents fast-caching)

Liquid
{%- blog_posts posts = start:1 limit:10 -%}
{%- var randompost = posts | rand -%}
<p>Random pick: {{ randompost.linked_title }}</p>

Get a random item from an existing list. Every time the page is loaded a new random item will be chosen.

One random item from an existing list (allows fast-caching)

Liquid
{%- blog_posts posts = start:1 limit:10 -%}
{%- var randompost = posts | rand:1, false, false -%}
<p>Fast-Cached Random pick: {{ randompost.linked_title }}</p>

Get a random item from an existing list and allow the page to be fast-cached. Subsequent pageloads will have the same random item chosen until the cache expires unless there is something else on the page that prevents fast-caching.

Improved: Fetch only one item from the database

Liquid
{%- blog_posts intermediate = limit:1 sort_by:'random' cache_random:true -%}
{%- var randompost = intermediate | first -%}
<p>Today's pick: {{ randompost.linked_title }}</p>

Functionally equivalent to the previous example, but only one item has to be fetched from the database. With the cache_random:true argument the result may be fast-cached and can be reused for subsequent pageloads and without the cache_random argument the page will not able to be fast-cached.

Multiple random items, no duplicates

Liquid
{%- var numbers = (10..20) -%}
{%- var randomitems = numbers | rand:3, false -%}
{{- randomitems | join:' ' -}}

Get 3 random numbers between 10 and 20 without repeats and outputs them as a space-separated list. Because the third argument is not provided the page will not be fast-cached and every pageload will have a new set of random numbers.

Multiple random numbers with duplicates allowed

Liquid
{%- var rolls = 6 | rand: 4 -%}
<p>Dice rolls: {{ rolls | join: ', ' }}</p>

Get 4 random numbers between 1 and 6 and output them as a comma-separated list. Because the second argument is not provided, duplicates are allowed. Because the third argument is not provided, the page will not be fast-cached and every pageload will have a new set of random numbers.

Multiple random numbers with duplicates allowed and fast-cacheable

Liquid
{%- var rolls = 6 | rand: 4, true, false -%}
<p>Dice rolls: {{ rolls | join: ', ' }}</p>

Functionally identical to the previous example except the page may be fast-cached so that future pageloads are significantly faster, but may include the same set of random numbers until the cache expires.

Multiple unique random numbers

Liquid
{%- var picks = 10 | rand: 4, false -%}
<p>Unique picks: {{ picks | join: ' ' }}</p>

Gets 4 unique random numbers between 1 and 10 and outputs them as a space-separated list. Because the third argument is not provided, the page will not be fast-cached and every pageload will have a new set of random numbers.

Single random number between 0 and 10

Liquid
{{ 11 | rand: 1 | minus: 1 }}

To get a random number starting with 0 we need to subtract 1 from the result. To allow the page to be fast-cached: Specify either true or false for the second argument (it doesn't matter which for this example) and specify false for the third argument.

Random character from a string (cache in page)

Liquid
{{ "aaabcdeeefghjkmnpqrstuuuvwxyz123456789-_" | rand }}

Gets a single random character from the set of characters in the string. In this example, the set of characters includes lowercase letters, numbers, and the hyphen and underscore characters with some characters excluded and some repeated to increase their probability of being chosen.

Random alphanumeric string

Liquid
{{ "abcdefghijklmnopqrstuvwxyz0123456789" | rand: 10 }}

Pick 10 random characters from the set, with duplicates allowed. Because the third argument is not provided, the page will not be fast-cached and every pageload will have a new set of random characters.

Random alphanumeric string without duplciates

Liquid
{{ "abcdefghijklmnopqrstuvwxyz0123456789-----_____" | rand: 10, false }}

Pick 10 random characters from the set, with no duplicates allowed. However, because the set itself contains 5 hyphens and 5 underscores the result may also contain up to 5 hyphens and 5 underscores. Because the third argument is provided as false, the page will not be fast-cached and every pageload will have a new set of random characters.

Example Get request parameters and fetch blog_posts with pagination and tag filterRead page and tag from query params, then fetch blog_posts with limit and sort.
Liquid
{%- assign var postsPerPage = 10 -%}
{%- assign pageParam = 1 -%} 
<!-- Did a page param get passed in the url? -->
{%- if request.query_params['page'] -%}
	{%- assign pageParam = request.query_params['page'] | to_int -%}
{%- endif -%}
<!-- Did a tag param get passed in the url? -->
{%- if request.query_params['tag'] and request.query_params['tag'] != "" -%}
	{%- assign tagFilter = request.query_params['tag'] | url_decode | downcase -%}
{%- endif -%}

{%- blog_posts assign posts = blog:"The Kitchen Essentials" tag:tagFilter limit:postsPerPage page:pageParam sort_by:"post_date" sort_direction:"desc" -%}

{%- for post in posts -%}
	{{-post.title-}}
{%- endfor -%}
Example Group blog posts by blog (group filter)Use the group_by filter to group objects by a specific property. For example, you can group a list of blog posts by blog.
Liquid
{%- blog_posts posts = limit: 40 start: 1 sort_by: 'date_posted' sort_direction: 'desc' -%}
{%- var grouped_by_blog = posts | group_by: 'blog' -%}
{%- for group in grouped_by_blog -%}
	<p>{{ group.Key.title }}: {{ group.Value | size }}</p>
{%- endfor -%}
Output
<p>General Blog: 22</p>
<p>Announcements: 10</p>
<p>Events: 8</p>
Example Map a list of blog posts to their linked titlesUse the map filter to map blog posts to their linked title. The map filter could just as easily be used for any other property as well.
Liquid
{%- blog_posts posts = limit: 10 sort_by: 'post_date' sort_direction:'desc' -%}
{{- posts | map: 'linked_title' | join: '<br />' }}

{% blogs %}

{% blogs output_to_template? [[var, set, or assign]? variable]? output_to_template? = arguments %}
Parameters
output_to_template optionalflag
If included the {% blogs %} will be output directly to the template.
var, set, or assign optionalkeyword
Optional. Specify either "var", "set" or "assign" to change which scope this {% blogs %} is stored on. "var" is the default behavior.
variable optionalvariable
arguments requiredcollection
Key:value pairs. May use the variable arguments syntax.

Options

prepend optionallist
May be a single blog, a list of blogs, or the name or guid of one blog, to be included at the beginning of the blogs list.
append optionallist
May be a single blog, a list of blogs, or the name or guid of one blog, to be included at the end of the blogs list.
exclude optionallist
May be a single blog, a list of blogs, or the name or guid of one blog that should NOT be included in the fetched results. Has no effect on prepended or appended blogs.
exclude_prepended optionalboolean
True to specifically exclude all prepended blogs from the fetched results. If "unique:true" is specified this is the default behavior, although you may also specify "exclude_prepended:false" to allow any prepended items to be fetched along with other results anyway.
exclude_appended optionalboolean
True to specifically exclude all appended blogs from the fetched results. This is false by default - even if "unique:true" is specified - so that results are returned in the proper order.
unique optionalboolean
True to remove duplicates from each of the resulting lists (prepended, fetched, appended, and items), although there may be duplicates between the prepended, fetched, and appended lists. The "items" list will include objects in the order in which they appear - with prepended items first, then fetched items, then appended items.
max_size optionalinteger
The maximum number of items to be included in the "items" list. If there are any prepended or appended items, this will automatically lower the "limit" to only fetch as many blogs as needed. Note that this may also impact both the "page" and "total_pages" values in the resulting blogs. In order to use pagination with a list loaded using "max_size" use "start" instead of "page" and "limit".
filter optionalvalue
Only include blogs that match the given string filter
folder optionalvalue
May include multiple folders. Only include blogs with one of the given folders
date_created_start optionalvalue
Only include blogs with date_created greater than or equal to date_created_start. Remember that date_created will typically be the date that the blog was first published.
date_created_end optionalvalue
Only include blogs with date_created less than or equal to date_created_end. Remember that date_created will typically be the date that the blog was first published.
has_url optionalboolean
If true, only return blogs that have a URL. If false, only return blogs that do NOT have a URL.
template optionalobject
Only return blogs with one of these templates. May be a single template, a list of templates, or the name or guid of a template to filter the results by.
include_in_search optionalboolean
True or false to only return blogs whose include_in_search property matches the provided value.
domain_name optionalobject
Only return blogs from the given domain.
start optionalinteger
Set the 1-based index of the first blog to fetch.
page optionalinteger
Used to automatically calculate the first blog to fetch based on both the "limit" and the 1-based "page" value. Defaults to 1, but is ignored if "start" is set.
limit optionalinteger
The maximum number of blogs to fetch. Defaults to 10. Note that if "max_size" is defined, then "limit" may be automatically lowered even if specified separately.
sort_by optionalstring
Specify which property to sort the results by. Has no effect on prepended or appended blogs. By default, results will be sorted by relevance if there is a filter string and date_created desc (newest first) if not. Options include:
  • relevance: only applies when there is a filter string. When sorting by relevance sort_direction is ignored.
  • date_created: the date each blog was first published. Unpublishing and republishing one resets date_created to the current date.
  • random: results will be returned in a random order, which prevents the page from being fast-cached. Setting cache_random:true overrides this behavior and allows the page to be fast-cached anyway.
  • name
  • title
  • url
  • browser_title
sort_direction optionalstring
asc or desc.
cache_random optionalboolean
True to allow the results to be cached when sort_by is "random".

Fetches a list of {{ blogs }}.

{% calendar_entries %}

{% calendar_entries output_to_template? [[var, set, or assign]? variable]? output_to_template? = arguments %}
Parameters
output_to_template optionalflag
If included the {% calendar_entries %} will be output directly to the template.
var, set, or assign optionalkeyword
Optional. Specify either "var", "set" or "assign" to change which scope this {% calendar_entries %} is stored on. "var" is the default behavior.
variable optionalvariable
arguments requiredcollection
Key:value pairs. May use the variable arguments syntax.

Options

prepend optionallist
May be a single calendar_entry, a list of calendar_entries, or the name or guid of one calendar_entry, to be included at the beginning of the calendar_entries list.
append optionallist
May be a single calendar_entry, a list of calendar_entries, or the name or guid of one calendar_entry, to be included at the end of the calendar_entries list.
exclude optionallist
May be a single calendar_entry, a list of calendar_entries, or the name or guid of one calendar_entry that should NOT be included in the fetched results. Has no effect on prepended or appended calendar_entries.
exclude_prepended optionalboolean
True to specifically exclude all prepended calendar_entries from the fetched results. If "unique:true" is specified this is the default behavior, although you may also specify "exclude_prepended:false" to allow any prepended items to be fetched along with other results anyway.
exclude_appended optionalboolean
True to specifically exclude all appended calendar_entries from the fetched results. This is false by default - even if "unique:true" is specified - so that results are returned in the proper order.
unique optionalboolean
True to remove duplicates from each of the resulting lists (prepended, fetched, appended, and items), although there may be duplicates between the prepended, fetched, and appended lists. The "items" list will include objects in the order in which they appear - with prepended items first, then fetched items, then appended items.
max_size optionalinteger
The maximum number of items to be included in the "items" list. If there are any prepended or appended items, this will automatically lower the "limit" to only fetch as many calendar_entries as needed. Note that this may also impact both the "page" and "total_pages" values in the resulting calendar_entries. In order to use pagination with a list loaded using "max_size" use "start" instead of "page" and "limit".
filter optionalvalue
Only include calendar entries that match the given string filter
calendar optionalvalue
May include multiple calendars. Only include calendar entries with one of the given calendars
start_date optionalvalue
Only include calendar entries starting on or after start_date
end_date optionalvalue
Only include calendar entries ending on or before end_date
tag optionalvalue
May include multiple tags. Only include calendar entries with one of the given tags
author optionalvalue
May include multiple authors. Only include calendar entries with one of the given authors
folder optionalvalue
May include multiple folders. Only include calendar entries with one of the given folders
date_created_start optionalvalue
Only include calendar entries with date_created greater than or equal to date_created_start. Remember that date_created will typically be the date that the calendar entry was first published.
date_created_end optionalvalue
Only include calendar entries with date_created less than or equal to date_created_end. Remember that date_created will typically be the date that the calendar entry was first published.
has_url optionalboolean
If true, only return calendar_entries that have a URL. If false, only return calendar_entries that do NOT have a URL.
template optionalobject
Only return calendar_entries with one of these templates. May be a single template, a list of templates, or the name or guid of a template to filter the results by.
include_in_search optionalboolean
True or false to only return calendar_entries whose include_in_search property matches the provided value.
domain_name optionalobject
Only return calendar_entries from the given domain.
start optionalinteger
Set the 1-based index of the first calendar_entry to fetch.
page optionalinteger
Used to automatically calculate the first calendar_entry to fetch based on both the "limit" and the 1-based "page" value. Defaults to 1, but is ignored if "start" is set.
limit optionalinteger
The maximum number of calendar_entries to fetch. Defaults to 10. Note that if "max_size" is defined, then "limit" may be automatically lowered even if specified separately.
sort_by optionalstring
Specify which property to sort the results by. Has no effect on prepended or appended calendar_entries. By default, results will be sorted by relevance if there is a filter string and date_created desc (newest first) if not. Options include:
  • relevance: only applies when there is a filter string. When sorting by relevance sort_direction is ignored.
  • date_created: the date each calendar_entry was first published. Unpublishing and republishing one resets date_created to the current date.
  • random: results will be returned in a random order, which prevents the page from being fast-cached. Setting cache_random:true overrides this behavior and allows the page to be fast-cached anyway.
  • name
  • title
  • url
  • browser_title
sort_direction optionalstring
asc or desc.
cache_random optionalboolean
True to allow the results to be cached when sort_by is "random".

Fetches a list of {{ calendar_entries }}.

Example Fetch calendar_entries for the next month using assign and date filtersSet a date range (e.g. from now to one month ahead) and fetch calendar_entries into the template.
Liquid
{%- assign minDate = "now" | midnight -%}
{%- assign maxDate = minDate | add_months: 1 -%}
{%- calendar_entries output_to_template start_date:minDate end_date:maxDate limit:30 sort_by:"start_date" sort_direction:"asc" -%}
Example Get Calendar Entries for the Next MonthSet a date range with midnight and add_months, then fetch the next 30 calendar_entries sorted by start_date.
Liquid
{%- var minDate = "now" | midnight -%}
{%- var maxDate = "now" | midnight | add_months: 1 -%}
{%- calendar_entries var entries = start_date:minDate end_date:maxDate limit:30 sort_by:"start_date" sort_direction:"asc" -%}

{% calendars %}

{% calendars output_to_template? [[var, set, or assign]? variable]? output_to_template? = arguments %}
Parameters
output_to_template optionalflag
If included the {% calendars %} will be output directly to the template.
var, set, or assign optionalkeyword
Optional. Specify either "var", "set" or "assign" to change which scope this {% calendars %} is stored on. "var" is the default behavior.
variable optionalvariable
arguments requiredcollection
Key:value pairs. May use the variable arguments syntax.

Options

prepend optionallist
May be a single calendar, a list of calendars, or the name or guid of one calendar, to be included at the beginning of the calendars list.
append optionallist
May be a single calendar, a list of calendars, or the name or guid of one calendar, to be included at the end of the calendars list.
exclude optionallist
May be a single calendar, a list of calendars, or the name or guid of one calendar that should NOT be included in the fetched results. Has no effect on prepended or appended calendars.
exclude_prepended optionalboolean
True to specifically exclude all prepended calendars from the fetched results. If "unique:true" is specified this is the default behavior, although you may also specify "exclude_prepended:false" to allow any prepended items to be fetched along with other results anyway.
exclude_appended optionalboolean
True to specifically exclude all appended calendars from the fetched results. This is false by default - even if "unique:true" is specified - so that results are returned in the proper order.
unique optionalboolean
True to remove duplicates from each of the resulting lists (prepended, fetched, appended, and items), although there may be duplicates between the prepended, fetched, and appended lists. The "items" list will include objects in the order in which they appear - with prepended items first, then fetched items, then appended items.
max_size optionalinteger
The maximum number of items to be included in the "items" list. If there are any prepended or appended items, this will automatically lower the "limit" to only fetch as many calendars as needed. Note that this may also impact both the "page" and "total_pages" values in the resulting calendars. In order to use pagination with a list loaded using "max_size" use "start" instead of "page" and "limit".
filter optionalvalue
Only include calendars that match the given string filter
folder optionalvalue
May include multiple folders. Only include calendars with one of the given folders
date_created_start optionalvalue
Only include calendars with date_created greater than or equal to date_created_start. Remember that date_created will typically be the date that the calendar was first published.
date_created_end optionalvalue
Only include calendars with date_created less than or equal to date_created_end. Remember that date_created will typically be the date that the calendar was first published.
has_url optionalboolean
If true, only return calendars that have a URL. If false, only return calendars that do NOT have a URL.
template optionalobject
Only return calendars with one of these templates. May be a single template, a list of templates, or the name or guid of a template to filter the results by.
include_in_search optionalboolean
True or false to only return calendars whose include_in_search property matches the provided value.
domain_name optionalobject
Only return calendars from the given domain.
start optionalinteger
Set the 1-based index of the first calendar to fetch.
page optionalinteger
Used to automatically calculate the first calendar to fetch based on both the "limit" and the 1-based "page" value. Defaults to 1, but is ignored if "start" is set.
limit optionalinteger
The maximum number of calendars to fetch. Defaults to 10. Note that if "max_size" is defined, then "limit" may be automatically lowered even if specified separately.
sort_by optionalstring
Specify which property to sort the results by. Has no effect on prepended or appended calendars. By default, results will be sorted by relevance if there is a filter string and date_created desc (newest first) if not. Options include:
  • relevance: only applies when there is a filter string. When sorting by relevance sort_direction is ignored.
  • date_created: the date each calendar was first published. Unpublishing and republishing one resets date_created to the current date.
  • random: results will be returned in a random order, which prevents the page from being fast-cached. Setting cache_random:true overrides this behavior and allows the page to be fast-cached anyway.
  • name
  • title
  • url
  • browser_title
sort_direction optionalstring
asc or desc.
cache_random optionalboolean
True to allow the results to be cached when sort_by is "random".

Fetches a list of {{ calendars }}.

{% datastore_items %}

{% datastore_items output_to_template? [[var, set, or assign]? variable]? output_to_template? = arguments %}
Parameters
output_to_template optionalflag
If included the {% datastore_items %} will be output directly to the template.
var, set, or assign optionalkeyword
Optional. Specify either "var", "set" or "assign" to change which scope this {% datastore_items %} is stored on. "var" is the default behavior.
variable optionalvariable
arguments requiredcollection
Key:value pairs. May use the variable arguments syntax.

Options

prepend optionallist
May be a single datastore_item, a list of datastore_items, or the name or guid of one datastore_item, to be included at the beginning of the datastore_items list.
append optionallist
May be a single datastore_item, a list of datastore_items, or the name or guid of one datastore_item, to be included at the end of the datastore_items list.
exclude optionallist
May be a single datastore_item, a list of datastore_items, or the name or guid of one datastore_item that should NOT be included in the fetched results. Has no effect on prepended or appended datastore_items.
exclude_prepended optionalboolean
True to specifically exclude all prepended datastore_items from the fetched results. If "unique:true" is specified this is the default behavior, although you may also specify "exclude_prepended:false" to allow any prepended items to be fetched along with other results anyway.
exclude_appended optionalboolean
True to specifically exclude all appended datastore_items from the fetched results. This is false by default - even if "unique:true" is specified - so that results are returned in the proper order.
unique optionalboolean
True to remove duplicates from each of the resulting lists (prepended, fetched, appended, and items), although there may be duplicates between the prepended, fetched, and appended lists. The "items" list will include objects in the order in which they appear - with prepended items first, then fetched items, then appended items.
max_size optionalinteger
The maximum number of items to be included in the "items" list. If there are any prepended or appended items, this will automatically lower the "limit" to only fetch as many datastore_items as needed. Note that this may also impact both the "page" and "total_pages" values in the resulting datastore_items. In order to use pagination with a list loaded using "max_size" use "start" instead of "page" and "limit".
filter optionalvalue
Only include datastore items that match the given string filter
datastore optionalvalue
May include multiple datastores. Only include datastore items with one of the given datastores
query optionalvalue
Only include datastore items which match the given query. Datastore item queries have their own advanced syntax, which may be reviewed at https://help.marketpath.com/liquid/advanced-datastore-queries
tag optionalvalue
May include multiple tags. Only include datastore items with one of the given tags
author optionalvalue
May include multiple authors. Only include datastore items with one of the given authors
folder optionalvalue
May include multiple folders. Only include datastore items with one of the given folders
date_created_start optionalvalue
Only include datastore items with date_created greater than or equal to date_created_start. Remember that date_created will typically be the date that the datastore item was first published.
date_created_end optionalvalue
Only include datastore items with date_created less than or equal to date_created_end. Remember that date_created will typically be the date that the datastore item was first published.
has_url optionalboolean
If true, only return datastore_items that have a URL. If false, only return datastore_items that do NOT have a URL.
template optionalobject
Only return datastore_items with one of these templates. May be a single template, a list of templates, or the name or guid of a template to filter the results by.
include_in_search optionalboolean
True or false to only return datastore_items whose include_in_search property matches the provided value.
domain_name optionalobject
Only return datastore_items from the given domain.
start optionalinteger
Set the 1-based index of the first datastore_item to fetch.
page optionalinteger
Used to automatically calculate the first datastore_item to fetch based on both the "limit" and the 1-based "page" value. Defaults to 1, but is ignored if "start" is set.
limit optionalinteger
The maximum number of datastore_items to fetch. Defaults to 10. Note that if "max_size" is defined, then "limit" may be automatically lowered even if specified separately.
sort_by optionalstring
Specify which property to sort the results by. Has no effect on prepended or appended datastore_items. By default, results will be sorted by relevance if there is a filter string and date_created desc (newest first) if not. Options include:
  • relevance: only applies when there is a filter string. When sorting by relevance sort_direction is ignored.
  • date_created: the date each datastore_item was first published. Unpublishing and republishing one resets date_created to the current date.
  • random: results will be returned in a random order, which prevents the page from being fast-cached. Setting cache_random:true overrides this behavior and allows the page to be fast-cached anyway.
  • name
  • title
  • url
  • browser_title
sort_direction optionalstring
asc or desc.
cache_random optionalboolean
True to allow the results to be cached when sort_by is "random".

Fetches a list of {{ datastore_items }}.

Example Getting and manipulating entity listsUse the list methods and filters to create and manage lists of data in your templates
Liquid
{%- datastore_items var featured_houses = datastore:"houses" query:"is_featured = true" -%}
{%- datastore_items var houses_by_folder = datastore:"houses" folder:entity.folder -%}

Concatenate and uniq the easy way

Liquid
{% datastore_items var houses = featured_houses houses_by_folder unique %}

Concatenate manually

Liquid
{% var houses = featured_houses | concat: houses_by_folder %}

Unique manually

Liquid
{% var houses = houses | uniq %}

Get one random item from the list

Liquid
{% var random_house = houses | rand %}

Get a random item from the list. Prevents the page from being fast-cached, and every time the page is loaded a new random item will be chosen.

Get one random item from the list and allow fast-caching

Liquid
{% var random_house = houses | rand:1, false, false %}

Get a random item from the list and allow the page to be fast-cached, resulting in much faster pageload speeds but the same random item will be used until the fast cache expires.

Sort the full list randomly

Liquid
{% set houses = houses | shuffle %}

Sort the full list randomly. The page will not be able to be fast-cached, and every time the page is loaded a new random order will be chosen. To allow the page to be fast-cached, pass false to the shuffle command.

Various ways to filter and slice

Liquid
{%- var one_rooms = houses | where: "rooms", "1" | sort: "price" -%}
{%- var cheapest = one_rooms | first -%}
{%- var mid_houses = one_rooms | slice: 1, 6 -%}
{%- var expensive_houses = one_rooms | slice: 7 -%}
{%- var num_expensive_houses = expensive_houses | size -%}

Advanced filter

Liquid
{% var few_rooms = houses | where_exp: "house", "house.rooms.value < 3" %}

Grouping

Liquid
{%- var grouped_by_rooms = houses | group_by: "rooms" | sort: "Key" -%}
{%- for list in grouped_by_rooms -%}
	<p>{{list.Key | default: "Unknown"}} Rooms ({{list.Value | size }} houses)</p>
{%- endfor -%}

Mapping and Compact

Liquid
{%- var mapped_by_rooms = grouped_by_rooms | map: "Value" -%}
{%- for list in mapped_by_rooms -%}
	<h4>{{list[0].rooms | default: "Unknown"}} Rooms</h4>
	<ul>
		<li>{{list | map: "description" | compact | join: "</li><li>" }}</li>
	</ul>
{%- endfor -%}
Example Get datastore items using an advanced queryBuild a query string from request params and pass it to datastore_items to filter by custom fields (e.g. beds, baths).
Liquid
{%- var query = "movein_ready = true" -%}
{%- if request.query_params.beds is_int -%}
	{%- set query = query | append: " and beds = " | append: request.query_params.beds -%}
{%- endif -%}
{%- if request.query_params.baths is_int -%}
	{%- set query = query | append: " and baths = " | append: request.query_params.baths -%}
{%- endif -%}
{%- datastore_items collection = datastore:entity query:query -%}
Example Sample datastore item queriesExample datastore_item queries showing common filters, sort, and limit patterns.
Liquid
Simple query: {% datastore_items items = datastore:"Hotels" query:"number_of_rooms > 100 AND average_room_price <= 100" -%}


Complex query:
{%- capture query -%}
  is_vegan
  OR
  (
	number_of_ingredients < 6
	AND (
	  NOT ingredients contains chicken
	  -ingredients contains pork
	  - ingredients LIKE 'beef'
	  {%- if other_meat_to_avoid is_valid -%}
		AND !(ingredients CONTAINS "{{other_meat_to_avoid | replace: '"', '""' }}")
	  {%- endif -%}
	)
	AND NOT (
	  'contains_dairy'
	  OR ingredients contains egg
	)
  )
{%- endcapture -%}
{%- datastore_items items = datastore:'Recipes' query:query -%}


Query multiple configurable fields:
{%- set query = "" -%}
{%- set fieldvalue = request.query_params['fieldvalue'] | urldecode -%}
{%- if request.query_params['fieldnames'] is_valid and fieldvalue is_valid -%}
  {%- var fieldnames = request.query_params['fieldnames'] | urldecode | split: ',' -%}
  {%- var queryparts = '' | compact -%}
  {%- for field in fieldnames -%}
	{%- capture querypart %}{{field}} = "{{fieldvalue | replace: '"', '""'}}"{% endcapture -%}
	{%- set queryparts = queryparts | concat: querypart -%}
  {%- endfor -%}
  {%- set query = queryparts | join: ' OR ' -%}
{%- endif -%}
{%- datastore_items items = datastore:entity query:query -%}

{% datastores %}

{% datastores output_to_template? [[var, set, or assign]? variable]? output_to_template? = arguments %}
Parameters
output_to_template optionalflag
If included the {% datastores %} will be output directly to the template.
var, set, or assign optionalkeyword
Optional. Specify either "var", "set" or "assign" to change which scope this {% datastores %} is stored on. "var" is the default behavior.
variable optionalvariable
arguments requiredcollection
Key:value pairs. May use the variable arguments syntax.

Options

prepend optionallist
May be a single datastore, a list of datastores, or the name or guid of one datastore, to be included at the beginning of the datastores list.
append optionallist
May be a single datastore, a list of datastores, or the name or guid of one datastore, to be included at the end of the datastores list.
exclude optionallist
May be a single datastore, a list of datastores, or the name or guid of one datastore that should NOT be included in the fetched results. Has no effect on prepended or appended datastores.
exclude_prepended optionalboolean
True to specifically exclude all prepended datastores from the fetched results. If "unique:true" is specified this is the default behavior, although you may also specify "exclude_prepended:false" to allow any prepended items to be fetched along with other results anyway.
exclude_appended optionalboolean
True to specifically exclude all appended datastores from the fetched results. This is false by default - even if "unique:true" is specified - so that results are returned in the proper order.
unique optionalboolean
True to remove duplicates from each of the resulting lists (prepended, fetched, appended, and items), although there may be duplicates between the prepended, fetched, and appended lists. The "items" list will include objects in the order in which they appear - with prepended items first, then fetched items, then appended items.
max_size optionalinteger
The maximum number of items to be included in the "items" list. If there are any prepended or appended items, this will automatically lower the "limit" to only fetch as many datastores as needed. Note that this may also impact both the "page" and "total_pages" values in the resulting datastores. In order to use pagination with a list loaded using "max_size" use "start" instead of "page" and "limit".
filter optionalvalue
Only include datastores that match the given string filter
folder optionalvalue
May include multiple folders. Only include datastores with one of the given folders
date_created_start optionalvalue
Only include datastores with date_created greater than or equal to date_created_start. Remember that date_created will typically be the date that the datastore was first published.
date_created_end optionalvalue
Only include datastores with date_created less than or equal to date_created_end. Remember that date_created will typically be the date that the datastore was first published.
has_url optionalboolean
If true, only return datastores that have a URL. If false, only return datastores that do NOT have a URL.
template optionalobject
Only return datastores with one of these templates. May be a single template, a list of templates, or the name or guid of a template to filter the results by.
include_in_search optionalboolean
True or false to only return datastores whose include_in_search property matches the provided value.
domain_name optionalobject
Only return datastores from the given domain.
start optionalinteger
Set the 1-based index of the first datastore to fetch.
page optionalinteger
Used to automatically calculate the first datastore to fetch based on both the "limit" and the 1-based "page" value. Defaults to 1, but is ignored if "start" is set.
limit optionalinteger
The maximum number of datastores to fetch. Defaults to 10. Note that if "max_size" is defined, then "limit" may be automatically lowered even if specified separately.
sort_by optionalstring
Specify which property to sort the results by. Has no effect on prepended or appended datastores. By default, results will be sorted by relevance if there is a filter string and date_created desc (newest first) if not. Options include:
  • relevance: only applies when there is a filter string. When sorting by relevance sort_direction is ignored.
  • date_created: the date each datastore was first published. Unpublishing and republishing one resets date_created to the current date.
  • random: results will be returned in a random order, which prevents the page from being fast-cached. Setting cache_random:true overrides this behavior and allows the page to be fast-cached anyway.
  • name
  • title
  • url
  • browser_title
sort_direction optionalstring
asc or desc.
cache_random optionalboolean
True to allow the results to be cached when sort_by is "random".

Fetches a list of {{ datastores }}.

{% documents %}

{% documents output_to_template? [[var, set, or assign]? variable]? output_to_template? = arguments %}
Parameters
output_to_template optionalflag
If included the {% documents %} will be output directly to the template.
var, set, or assign optionalkeyword
Optional. Specify either "var", "set" or "assign" to change which scope this {% documents %} is stored on. "var" is the default behavior.
variable optionalvariable
arguments requiredcollection
Key:value pairs. May use the variable arguments syntax.

Options

prepend optionallist
May be a single document, a list of documents, or the name or guid of one document, to be included at the beginning of the documents list.
append optionallist
May be a single document, a list of documents, or the name or guid of one document, to be included at the end of the documents list.
exclude optionallist
May be a single document, a list of documents, or the name or guid of one document that should NOT be included in the fetched results. Has no effect on prepended or appended documents.
exclude_prepended optionalboolean
True to specifically exclude all prepended documents from the fetched results. If "unique:true" is specified this is the default behavior, although you may also specify "exclude_prepended:false" to allow any prepended items to be fetched along with other results anyway.
exclude_appended optionalboolean
True to specifically exclude all appended documents from the fetched results. This is false by default - even if "unique:true" is specified - so that results are returned in the proper order.
unique optionalboolean
True to remove duplicates from each of the resulting lists (prepended, fetched, appended, and items), although there may be duplicates between the prepended, fetched, and appended lists. The "items" list will include objects in the order in which they appear - with prepended items first, then fetched items, then appended items.
max_size optionalinteger
The maximum number of items to be included in the "items" list. If there are any prepended or appended items, this will automatically lower the "limit" to only fetch as many documents as needed. Note that this may also impact both the "page" and "total_pages" values in the resulting documents. In order to use pagination with a list loaded using "max_size" use "start" instead of "page" and "limit".
filter optionalvalue
Only include documents that match the given string filter
tag optionalvalue
May include multiple tags. Only include documents with one of the given tags
author optionalvalue
May include multiple authors. Only include documents with one of the given authors
folder optionalvalue
May include multiple folders. Only include documents with one of the given folders
date_created_start optionalvalue
Only include documents with date_created greater than or equal to date_created_start. Remember that date_created will typically be the date that the document was first published.
date_created_end optionalvalue
Only include documents with date_created less than or equal to date_created_end. Remember that date_created will typically be the date that the document was first published.
has_url optionalboolean
If true, only return documents that have a URL. If false, only return documents that do NOT have a URL.
template optionalobject
Only return documents with one of these templates. May be a single template, a list of templates, or the name or guid of a template to filter the results by.
include_in_search optionalboolean
True or false to only return documents whose include_in_search property matches the provided value.
domain_name optionalobject
Only return documents from the given domain.
start optionalinteger
Set the 1-based index of the first document to fetch.
page optionalinteger
Used to automatically calculate the first document to fetch based on both the "limit" and the 1-based "page" value. Defaults to 1, but is ignored if "start" is set.
limit optionalinteger
The maximum number of documents to fetch. Defaults to 10. Note that if "max_size" is defined, then "limit" may be automatically lowered even if specified separately.
sort_by optionalstring
Specify which property to sort the results by. Has no effect on prepended or appended documents. By default, results will be sorted by relevance if there is a filter string and date_created desc (newest first) if not. Options include:
  • relevance: only applies when there is a filter string. When sorting by relevance sort_direction is ignored.
  • date_created: the date each document was first published. Unpublishing and republishing one resets date_created to the current date.
  • random: results will be returned in a random order, which prevents the page from being fast-cached. Setting cache_random:true overrides this behavior and allows the page to be fast-cached anyway.
  • name
  • title
  • url
  • browser_title
sort_direction optionalstring
asc or desc.
cache_random optionalboolean
True to allow the results to be cached when sort_by is "random".

Fetches a list of {{ documents }}.

{% entities %}

{% entities output_to_template? [[var, set, or assign]? variable]? output_to_template? = arguments %}
Parameters
output_to_template optionalflag
If included the {% entities %} will be output directly to the template.
var, set, or assign optionalkeyword
Optional. Specify either "var", "set" or "assign" to change which scope this {% entities %} is stored on. "var" is the default behavior.
variable optionalvariable
arguments requiredcollection
Key:value pairs. May use the variable arguments syntax.

Options

prepend optionallist
May be a single , a list of entities, or the name or guid of one , to be included at the beginning of the entities list.
append optionallist
May be a single , a list of entities, or the name or guid of one , to be included at the end of the entities list.
exclude optionallist
May be a single , a list of entities, or the name or guid of one that should NOT be included in the fetched results. Has no effect on prepended or appended entities.
exclude_prepended optionalboolean
True to specifically exclude all prepended entities from the fetched results. If "unique:true" is specified this is the default behavior, although you may also specify "exclude_prepended:false" to allow any prepended items to be fetched along with other results anyway.
exclude_appended optionalboolean
True to specifically exclude all appended entities from the fetched results. This is false by default - even if "unique:true" is specified - so that results are returned in the proper order.
unique optionalboolean
True to remove duplicates from each of the resulting lists (prepended, fetched, appended, and items), although there may be duplicates between the prepended, fetched, and appended lists. The "items" list will include objects in the order in which they appear - with prepended items first, then fetched items, then appended items.
max_size optionalinteger
The maximum number of items to be included in the "items" list. If there are any prepended or appended items, this will automatically lower the "limit" to only fetch as many entities as needed. Note that this may also impact both the "page" and "total_pages" values in the resulting entities. In order to use pagination with a list loaded using "max_size" use "start" instead of "page" and "limit".
filter optionalvalue
Only include entities that match the given string filter
global_type_id optionalvalue
May include multiple types. Only include entities of the given types.
tag optionalvalue
May include multiple tags. Only include entities with one of the given tags
author optionalvalue
May include multiple authors. Only include entities with one of the given authors
folder optionalvalue
May include multiple folders. Only include entities with one of the given folders
date_created_start optionalvalue
Only include entities with date_created greater than or equal to date_created_start. Remember that date_created will typically be the date that the entity was first published.
date_created_end optionalvalue
Only include entities with date_created less than or equal to date_created_end. Remember that date_created will typically be the date that the entity was first published.
start optionalinteger
Set the 1-based index of the first to fetch.
page optionalinteger
Used to automatically calculate the first to fetch based on both the "limit" and the 1-based "page" value. Defaults to 1, but is ignored if "start" is set.
limit optionalinteger
The maximum number of entities to fetch. Defaults to 10. Note that if "max_size" is defined, then "limit" may be automatically lowered even if specified separately.
sort_by optionalstring
Specify which property to sort the results by. Has no effect on prepended or appended entities. By default, results will be sorted by relevance if there is a filter string and date_created desc (newest first) if not. Options include:
  • relevance: only applies when there is a filter string. When sorting by relevance sort_direction is ignored.
  • date_created: the date each was first published. Unpublishing and republishing one resets date_created to the current date.
  • random: results will be returned in a random order, which prevents the page from being fast-cached. Setting cache_random:true overrides this behavior and allows the page to be fast-cached anyway.
  • name
  • title
  • url
  • browser_title
sort_direction optionalstring
asc or desc.
cache_random optionalboolean
True to allow the results to be cached when sort_by is "random".

Fetches a list of {{ entities }}.

{% error_pages %}

{% error_pages output_to_template? [[var, set, or assign]? variable]? output_to_template? = arguments %}
Parameters
output_to_template optionalflag
If included the {% error_pages %} will be output directly to the template.
var, set, or assign optionalkeyword
Optional. Specify either "var", "set" or "assign" to change which scope this {% error_pages %} is stored on. "var" is the default behavior.
variable optionalvariable
arguments requiredcollection
Key:value pairs. May use the variable arguments syntax.

Options

prepend optionallist
May be a single error_page, a list of error_pages, or the name or guid of one error_page, to be included at the beginning of the error_pages list.
append optionallist
May be a single error_page, a list of error_pages, or the name or guid of one error_page, to be included at the end of the error_pages list.
exclude optionallist
May be a single error_page, a list of error_pages, or the name or guid of one error_page that should NOT be included in the fetched results. Has no effect on prepended or appended error_pages.
exclude_prepended optionalboolean
True to specifically exclude all prepended error_pages from the fetched results. If "unique:true" is specified this is the default behavior, although you may also specify "exclude_prepended:false" to allow any prepended items to be fetched along with other results anyway.
exclude_appended optionalboolean
True to specifically exclude all appended error_pages from the fetched results. This is false by default - even if "unique:true" is specified - so that results are returned in the proper order.
unique optionalboolean
True to remove duplicates from each of the resulting lists (prepended, fetched, appended, and items), although there may be duplicates between the prepended, fetched, and appended lists. The "items" list will include objects in the order in which they appear - with prepended items first, then fetched items, then appended items.
max_size optionalinteger
The maximum number of items to be included in the "items" list. If there are any prepended or appended items, this will automatically lower the "limit" to only fetch as many error_pages as needed. Note that this may also impact both the "page" and "total_pages" values in the resulting error_pages. In order to use pagination with a list loaded using "max_size" use "start" instead of "page" and "limit".
folder optionalvalue
May include multiple folders. Only include error pages with one of the given folders
date_created_start optionalvalue
Only include error pages with date_created greater than or equal to date_created_start. Remember that date_created will typically be the date that the error page was first published.
date_created_end optionalvalue
Only include error pages with date_created less than or equal to date_created_end. Remember that date_created will typically be the date that the error page was first published.
has_url optionalboolean
If true, only return error_pages that have a URL. If false, only return error_pages that do NOT have a URL.
template optionalobject
Only return error_pages with one of these templates. May be a single template, a list of templates, or the name or guid of a template to filter the results by.
include_in_search optionalboolean
True or false to only return error_pages whose include_in_search property matches the provided value.
domain_name optionalobject
Only return error_pages from the given domain.
start optionalinteger
Set the 1-based index of the first error_page to fetch.
page optionalinteger
Used to automatically calculate the first error_page to fetch based on both the "limit" and the 1-based "page" value. Defaults to 1, but is ignored if "start" is set.
limit optionalinteger
The maximum number of error_pages to fetch. Defaults to 10. Note that if "max_size" is defined, then "limit" may be automatically lowered even if specified separately.
sort_by optionalstring
Specify which property to sort the results by. Has no effect on prepended or appended error_pages. Options include:
  • date_created: the date each error_page was first published. Unpublishing and republishing one resets date_created to the current date.
  • random: results will be returned in a random order, which prevents the page from being fast-cached. Setting cache_random:true overrides this behavior and allows the page to be fast-cached anyway.
  • name
  • title
  • url
  • browser_title
sort_direction optionalstring
asc or desc.
cache_random optionalboolean
True to allow the results to be cached when sort_by is "random".

Fetches a list of {{ error_pages }}.

{% folders %}

{% folders output_to_template? [[var, set, or assign]? variable]? output_to_template? = arguments %}
Parameters
output_to_template optionalflag
If included the {% folders %} will be output directly to the template.
var, set, or assign optionalkeyword
Optional. Specify either "var", "set" or "assign" to change which scope this {% folders %} is stored on. "var" is the default behavior.
variable optionalvariable
arguments requiredcollection
Key:value pairs. May use the variable arguments syntax.

Options

prepend optionallist
May be a single folder, a list of folders, or the name or guid of one folder, to be included at the beginning of the folders list.
append optionallist
May be a single folder, a list of folders, or the name or guid of one folder, to be included at the end of the folders list.
exclude optionallist
May be a single folder, a list of folders, or the name or guid of one folder that should NOT be included in the fetched results. Has no effect on prepended or appended folders.
exclude_prepended optionalboolean
True to specifically exclude all prepended folders from the fetched results. If "unique:true" is specified this is the default behavior, although you may also specify "exclude_prepended:false" to allow any prepended items to be fetched along with other results anyway.
exclude_appended optionalboolean
True to specifically exclude all appended folders from the fetched results. This is false by default - even if "unique:true" is specified - so that results are returned in the proper order.
unique optionalboolean
True to remove duplicates from each of the resulting lists (prepended, fetched, appended, and items), although there may be duplicates between the prepended, fetched, and appended lists. The "items" list will include objects in the order in which they appear - with prepended items first, then fetched items, then appended items.
max_size optionalinteger
The maximum number of items to be included in the "items" list. If there are any prepended or appended items, this will automatically lower the "limit" to only fetch as many folders as needed. Note that this may also impact both the "page" and "total_pages" values in the resulting folders. In order to use pagination with a list loaded using "max_size" use "start" instead of "page" and "limit".
filter optionalvalue
Only include folders that match the given string filter
folder optionalvalue
May include multiple folders. Only include folders that are immediate children of one of the given folders
date_created_start optionalvalue
Only include folders with date_created greater than or equal to date_created_start. Remember that date_created will typically be the date that the folder was first published.
date_created_end optionalvalue
Only include folders with date_created less than or equal to date_created_end. Remember that date_created will typically be the date that the folder was first published.
has_url optionalboolean
If true, only return folders that have a URL. If false, only return folders that do NOT have a URL.
template optionalobject
Only return folders with one of these templates. May be a single template, a list of templates, or the name or guid of a template to filter the results by.
include_in_search optionalboolean
True or false to only return folders whose include_in_search property matches the provided value.
domain_name optionalobject
Only return folders from the given domain.
start optionalinteger
Set the 1-based index of the first folder to fetch.
page optionalinteger
Used to automatically calculate the first folder to fetch based on both the "limit" and the 1-based "page" value. Defaults to 1, but is ignored if "start" is set.
limit optionalinteger
The maximum number of folders to fetch. Defaults to 10. Note that if "max_size" is defined, then "limit" may be automatically lowered even if specified separately.
sort_by optionalstring
Specify which property to sort the results by. Has no effect on prepended or appended folders. By default, results will be sorted by relevance if there is a filter string and date_created desc (newest first) if not. Options include:
  • relevance: only applies when there is a filter string. When sorting by relevance sort_direction is ignored.
  • date_created: the date each folder was first published. Unpublishing and republishing one resets date_created to the current date.
  • random: results will be returned in a random order, which prevents the page from being fast-cached. Setting cache_random:true overrides this behavior and allows the page to be fast-cached anyway.
  • name
  • title
  • url
  • browser_title
sort_direction optionalstring
asc or desc.
cache_random optionalboolean
True to allow the results to be cached when sort_by is "random".

Fetches a list of {{ folders }}.

{% forms %}

{% forms output_to_template? [[var, set, or assign]? variable]? output_to_template? = arguments %}
Parameters
output_to_template optionalflag
If included the {% forms %} will be output directly to the template.
var, set, or assign optionalkeyword
Optional. Specify either "var", "set" or "assign" to change which scope this {% forms %} is stored on. "var" is the default behavior.
variable optionalvariable
arguments requiredcollection
Key:value pairs. May use the variable arguments syntax.

Options

prepend optionallist
May be a single form, a list of forms, or the name or guid of one form, to be included at the beginning of the forms list.
append optionallist
May be a single form, a list of forms, or the name or guid of one form, to be included at the end of the forms list.
exclude optionallist
May be a single form, a list of forms, or the name or guid of one form that should NOT be included in the fetched results. Has no effect on prepended or appended forms.
exclude_prepended optionalboolean
True to specifically exclude all prepended forms from the fetched results. If "unique:true" is specified this is the default behavior, although you may also specify "exclude_prepended:false" to allow any prepended items to be fetched along with other results anyway.
exclude_appended optionalboolean
True to specifically exclude all appended forms from the fetched results. This is false by default - even if "unique:true" is specified - so that results are returned in the proper order.
unique optionalboolean
True to remove duplicates from each of the resulting lists (prepended, fetched, appended, and items), although there may be duplicates between the prepended, fetched, and appended lists. The "items" list will include objects in the order in which they appear - with prepended items first, then fetched items, then appended items.
max_size optionalinteger
The maximum number of items to be included in the "items" list. If there are any prepended or appended items, this will automatically lower the "limit" to only fetch as many forms as needed. Note that this may also impact both the "page" and "total_pages" values in the resulting forms. In order to use pagination with a list loaded using "max_size" use "start" instead of "page" and "limit".
filter optionalvalue
Only include forms that match the given string filter
folder optionalvalue
May include multiple folders. Only include forms with one of the given folders
date_created_start optionalvalue
Only include forms with date_created greater than or equal to date_created_start. Remember that date_created will typically be the date that the form was first published.
date_created_end optionalvalue
Only include forms with date_created less than or equal to date_created_end. Remember that date_created will typically be the date that the form was first published.
has_url optionalboolean
If true, only return forms that have a URL. If false, only return forms that do NOT have a URL.
template optionalobject
Only return forms with one of these templates. May be a single template, a list of templates, or the name or guid of a template to filter the results by.
include_in_search optionalboolean
True or false to only return forms whose include_in_search property matches the provided value.
domain_name optionalobject
Only return forms from the given domain.
start optionalinteger
Set the 1-based index of the first form to fetch.
page optionalinteger
Used to automatically calculate the first form to fetch based on both the "limit" and the 1-based "page" value. Defaults to 1, but is ignored if "start" is set.
limit optionalinteger
The maximum number of forms to fetch. Defaults to 10. Note that if "max_size" is defined, then "limit" may be automatically lowered even if specified separately.
sort_by optionalstring
Specify which property to sort the results by. Has no effect on prepended or appended forms. By default, results will be sorted by relevance if there is a filter string and date_created desc (newest first) if not. Options include:
  • relevance: only applies when there is a filter string. When sorting by relevance sort_direction is ignored.
  • date_created: the date each form was first published. Unpublishing and republishing one resets date_created to the current date.
  • random: results will be returned in a random order, which prevents the page from being fast-cached. Setting cache_random:true overrides this behavior and allows the page to be fast-cached anyway.
  • name
  • title
  • url
  • browser_title
sort_direction optionalstring
asc or desc.
cache_random optionalboolean
True to allow the results to be cached when sort_by is "random".

Fetches a list of {{ forms }}.

{% galleries %}

{% galleries output_to_template? [[var, set, or assign]? variable]? output_to_template? = arguments %}
Parameters
output_to_template optionalflag
If included the {% galleries %} will be output directly to the template.
var, set, or assign optionalkeyword
Optional. Specify either "var", "set" or "assign" to change which scope this {% galleries %} is stored on. "var" is the default behavior.
variable optionalvariable
arguments requiredcollection
Key:value pairs. May use the variable arguments syntax.

Options

prepend optionallist
May be a single gallery, a list of galleries, or the name or guid of one gallery, to be included at the beginning of the galleries list.
append optionallist
May be a single gallery, a list of galleries, or the name or guid of one gallery, to be included at the end of the galleries list.
exclude optionallist
May be a single gallery, a list of galleries, or the name or guid of one gallery that should NOT be included in the fetched results. Has no effect on prepended or appended galleries.
exclude_prepended optionalboolean
True to specifically exclude all prepended galleries from the fetched results. If "unique:true" is specified this is the default behavior, although you may also specify "exclude_prepended:false" to allow any prepended items to be fetched along with other results anyway.
exclude_appended optionalboolean
True to specifically exclude all appended galleries from the fetched results. This is false by default - even if "unique:true" is specified - so that results are returned in the proper order.
unique optionalboolean
True to remove duplicates from each of the resulting lists (prepended, fetched, appended, and items), although there may be duplicates between the prepended, fetched, and appended lists. The "items" list will include objects in the order in which they appear - with prepended items first, then fetched items, then appended items.
max_size optionalinteger
The maximum number of items to be included in the "items" list. If there are any prepended or appended items, this will automatically lower the "limit" to only fetch as many galleries as needed. Note that this may also impact both the "page" and "total_pages" values in the resulting galleries. In order to use pagination with a list loaded using "max_size" use "start" instead of "page" and "limit".
filter optionalvalue
Only include galleries that match the given string filter
tag optionalvalue
May include multiple tags. Only include galleries with one of the given tags
author optionalvalue
May include multiple authors. Only include galleries with one of the given authors
folder optionalvalue
May include multiple folders. Only include galleries with one of the given folders
date_created_start optionalvalue
Only include galleries with date_created greater than or equal to date_created_start. Remember that date_created will typically be the date that the gallery was first published.
date_created_end optionalvalue
Only include galleries with date_created less than or equal to date_created_end. Remember that date_created will typically be the date that the gallery was first published.
has_url optionalboolean
If true, only return galleries that have a URL. If false, only return galleries that do NOT have a URL.
template optionalobject
Only return galleries with one of these templates. May be a single template, a list of templates, or the name or guid of a template to filter the results by.
include_in_search optionalboolean
True or false to only return galleries whose include_in_search property matches the provided value.
domain_name optionalobject
Only return galleries from the given domain.
start optionalinteger
Set the 1-based index of the first gallery to fetch.
page optionalinteger
Used to automatically calculate the first gallery to fetch based on both the "limit" and the 1-based "page" value. Defaults to 1, but is ignored if "start" is set.
limit optionalinteger
The maximum number of galleries to fetch. Defaults to 10. Note that if "max_size" is defined, then "limit" may be automatically lowered even if specified separately.
sort_by optionalstring
Specify which property to sort the results by. Has no effect on prepended or appended galleries. By default, results will be sorted by relevance if there is a filter string and date_created desc (newest first) if not. Options include:
  • relevance: only applies when there is a filter string. When sorting by relevance sort_direction is ignored.
  • date_created: the date each gallery was first published. Unpublishing and republishing one resets date_created to the current date.
  • random: results will be returned in a random order, which prevents the page from being fast-cached. Setting cache_random:true overrides this behavior and allows the page to be fast-cached anyway.
  • name
  • title
  • url
  • browser_title
sort_direction optionalstring
asc or desc.
cache_random optionalboolean
True to allow the results to be cached when sort_by is "random".

Fetches a list of {{ galleries }}.

{% images %}

{% images output_to_template? [[var, set, or assign]? variable]? output_to_template? = arguments %}
Parameters
output_to_template optionalflag
If included the {% images %} will be output directly to the template.
var, set, or assign optionalkeyword
Optional. Specify either "var", "set" or "assign" to change which scope this {% images %} is stored on. "var" is the default behavior.
variable optionalvariable
arguments requiredcollection
Key:value pairs. May use the variable arguments syntax.

Options

prepend optionallist
May be a single image, a list of images, or the name or guid of one image, to be included at the beginning of the images list.
append optionallist
May be a single image, a list of images, or the name or guid of one image, to be included at the end of the images list.
exclude optionallist
May be a single image, a list of images, or the name or guid of one image that should NOT be included in the fetched results. Has no effect on prepended or appended images.
exclude_prepended optionalboolean
True to specifically exclude all prepended images from the fetched results. If "unique:true" is specified this is the default behavior, although you may also specify "exclude_prepended:false" to allow any prepended items to be fetched along with other results anyway.
exclude_appended optionalboolean
True to specifically exclude all appended images from the fetched results. This is false by default - even if "unique:true" is specified - so that results are returned in the proper order.
unique optionalboolean
True to remove duplicates from each of the resulting lists (prepended, fetched, appended, and items), although there may be duplicates between the prepended, fetched, and appended lists. The "items" list will include objects in the order in which they appear - with prepended items first, then fetched items, then appended items.
max_size optionalinteger
The maximum number of items to be included in the "items" list. If there are any prepended or appended items, this will automatically lower the "limit" to only fetch as many images as needed. Note that this may also impact both the "page" and "total_pages" values in the resulting images. In order to use pagination with a list loaded using "max_size" use "start" instead of "page" and "limit".
filter optionalvalue
Only include images that match the given string filter
tag optionalvalue
May include multiple tags. Only include images with one of the given tags
author optionalvalue
May include multiple authors. Only include images with one of the given authors
folder optionalvalue
May include multiple folders. Only include images with one of the given folders
date_created_start optionalvalue
Only include images with date_created greater than or equal to date_created_start. Remember that date_created will typically be the date that the image was first published.
date_created_end optionalvalue
Only include images with date_created less than or equal to date_created_end. Remember that date_created will typically be the date that the image was first published.
has_url optionalboolean
If true, only return images that have a URL. If false, only return images that do NOT have a URL.
template optionalobject
Only return images with one of these templates. May be a single template, a list of templates, or the name or guid of a template to filter the results by.
include_in_search optionalboolean
True or false to only return images whose include_in_search property matches the provided value.
domain_name optionalobject
Only return images from the given domain.
start optionalinteger
Set the 1-based index of the first image to fetch.
page optionalinteger
Used to automatically calculate the first image to fetch based on both the "limit" and the 1-based "page" value. Defaults to 1, but is ignored if "start" is set.
limit optionalinteger
The maximum number of images to fetch. Defaults to 10. Note that if "max_size" is defined, then "limit" may be automatically lowered even if specified separately.
sort_by optionalstring
Specify which property to sort the results by. Has no effect on prepended or appended images. By default, results will be sorted by relevance if there is a filter string and date_created desc (newest first) if not. Options include:
  • relevance: only applies when there is a filter string. When sorting by relevance sort_direction is ignored.
  • date_created: the date each image was first published. Unpublishing and republishing one resets date_created to the current date.
  • random: results will be returned in a random order, which prevents the page from being fast-cached. Setting cache_random:true overrides this behavior and allows the page to be fast-cached anyway.
  • name
  • title
  • url
  • browser_title
sort_direction optionalstring
asc or desc.
cache_random optionalboolean
True to allow the results to be cached when sort_by is "random".

Fetches a list of {{ images }}.

{% javascripts %}

{% javascripts output_to_template? [[var, set, or assign]? variable]? output_to_template? = arguments %}
Parameters
output_to_template optionalflag
If included the {% javascripts %} will be output directly to the template.
var, set, or assign optionalkeyword
Optional. Specify either "var", "set" or "assign" to change which scope this {% javascripts %} is stored on. "var" is the default behavior.
variable optionalvariable
arguments requiredcollection
Key:value pairs. May use the variable arguments syntax.

Options

prepend optionallist
May be a single javascript, a list of javascripts, or the name or guid of one javascript, to be included at the beginning of the javascripts list.
append optionallist
May be a single javascript, a list of javascripts, or the name or guid of one javascript, to be included at the end of the javascripts list.
exclude optionallist
May be a single javascript, a list of javascripts, or the name or guid of one javascript that should NOT be included in the fetched results. Has no effect on prepended or appended javascripts.
exclude_prepended optionalboolean
True to specifically exclude all prepended javascripts from the fetched results. If "unique:true" is specified this is the default behavior, although you may also specify "exclude_prepended:false" to allow any prepended items to be fetched along with other results anyway.
exclude_appended optionalboolean
True to specifically exclude all appended javascripts from the fetched results. This is false by default - even if "unique:true" is specified - so that results are returned in the proper order.
unique optionalboolean
True to remove duplicates from each of the resulting lists (prepended, fetched, appended, and items), although there may be duplicates between the prepended, fetched, and appended lists. The "items" list will include objects in the order in which they appear - with prepended items first, then fetched items, then appended items.
max_size optionalinteger
The maximum number of items to be included in the "items" list. If there are any prepended or appended items, this will automatically lower the "limit" to only fetch as many javascripts as needed. Note that this may also impact both the "page" and "total_pages" values in the resulting javascripts. In order to use pagination with a list loaded using "max_size" use "start" instead of "page" and "limit".
minify optionalvalue
Only include javascript objects that have the specified boolean value for their minify setting
path optionalvalue
May include multiple paths. Only include javascript objects with one of the given paths (excluding child paths)
date_created_start optionalvalue
Only include javascript objects with date_created greater than or equal to date_created_start. Remember that date_created will typically be the date that the javascript objects was first published.
date_created_end optionalvalue
Only include javascript objects with date_created less than or equal to date_created_end. Remember that date_created will typically be the date that the javascript object was first published.
start optionalinteger
Set the 1-based index of the first javascript to fetch.
page optionalinteger
Used to automatically calculate the first javascript to fetch based on both the "limit" and the 1-based "page" value. Defaults to 1, but is ignored if "start" is set.
limit optionalinteger
The maximum number of javascripts to fetch. Defaults to 10. Note that if "max_size" is defined, then "limit" may be automatically lowered even if specified separately.
sort_by optionalstring
Specify which property to sort the results by. Has no effect on prepended or appended javascripts. Options include:
  • date_created: the date each javascript was first published. Unpublishing and republishing one resets date_created to the current date.
  • random: results will be returned in a random order, which prevents the page from being fast-cached. Setting cache_random:true overrides this behavior and allows the page to be fast-cached anyway.
  • name
  • title
  • url
  • browser_title
sort_direction optionalstring
asc or desc.
cache_random optionalboolean
True to allow the results to be cached when sort_by is "random".

Fetches a list of {{ javascripts }}.

{% menu_items %}

{% menu_items output_to_template? [[var, set, or assign]? variable]? output_to_template? = arguments %}
Parameters
output_to_template optionalflag
If included the {% menu_items %} will be output directly to the template.
var, set, or assign optionalkeyword
Optional. Specify either "var", "set" or "assign" to change which scope this {% menu_items %} is stored on. "var" is the default behavior.
variable optionalvariable
arguments requiredcollection
Key:value pairs. May use the variable arguments syntax.

Options

prepend optionallist
May be a single menu_item, a list of menu_items, or the name or guid of one menu_item, to be included at the beginning of the menu_items list.
append optionallist
May be a single menu_item, a list of menu_items, or the name or guid of one menu_item, to be included at the end of the menu_items list.
exclude optionallist
May be a single menu_item, a list of menu_items, or the name or guid of one menu_item that should NOT be included in the fetched results. Has no effect on prepended or appended menu_items.
exclude_prepended optionalboolean
True to specifically exclude all prepended menu_items from the fetched results. If "unique:true" is specified this is the default behavior, although you may also specify "exclude_prepended:false" to allow any prepended items to be fetched along with other results anyway.
exclude_appended optionalboolean
True to specifically exclude all appended menu_items from the fetched results. This is false by default - even if "unique:true" is specified - so that results are returned in the proper order.
unique optionalboolean
True to remove duplicates from each of the resulting lists (prepended, fetched, appended, and items), although there may be duplicates between the prepended, fetched, and appended lists. The "items" list will include objects in the order in which they appear - with prepended items first, then fetched items, then appended items.
max_size optionalinteger
The maximum number of items to be included in the "items" list. If there are any prepended or appended items, this will automatically lower the "limit" to only fetch as many menu_items as needed. Note that this may also impact both the "page" and "total_pages" values in the resulting menu_items. In order to use pagination with a list loaded using "max_size" use "start" instead of "page" and "limit".
start optionalinteger
Set the 1-based index of the first menu_item to fetch.
page optionalinteger
Used to automatically calculate the first menu_item to fetch based on both the "limit" and the 1-based "page" value. Defaults to 1, but is ignored if "start" is set.
limit optionalinteger
The maximum number of menu_items to fetch. Defaults to 10. Note that if "max_size" is defined, then "limit" may be automatically lowered even if specified separately.
sort_by optionalstring
Specify which property to sort the results by. Has no effect on prepended or appended menu_items. Options include:
  • date_created: the date each menu_item was first published. Unpublishing and republishing one resets date_created to the current date.
  • random: results will be returned in a random order, which prevents the page from being fast-cached. Setting cache_random:true overrides this behavior and allows the page to be fast-cached anyway.
  • name
  • title
  • url
  • browser_title
sort_direction optionalstring
asc or desc.
cache_random optionalboolean
True to allow the results to be cached when sort_by is "random".

Fetches a list of {{ menu_items }}.

{% menus %}

{% menus output_to_template? [[var, set, or assign]? variable]? output_to_template? = arguments %}
Parameters
output_to_template optionalflag
If included the {% menus %} will be output directly to the template.
var, set, or assign optionalkeyword
Optional. Specify either "var", "set" or "assign" to change which scope this {% menus %} is stored on. "var" is the default behavior.
variable optionalvariable
arguments requiredcollection
Key:value pairs. May use the variable arguments syntax.

Options

prepend optionallist
May be a single menu, a list of menus, or the name or guid of one menu, to be included at the beginning of the menus list.
append optionallist
May be a single menu, a list of menus, or the name or guid of one menu, to be included at the end of the menus list.
exclude optionallist
May be a single menu, a list of menus, or the name or guid of one menu that should NOT be included in the fetched results. Has no effect on prepended or appended menus.
exclude_prepended optionalboolean
True to specifically exclude all prepended menus from the fetched results. If "unique:true" is specified this is the default behavior, although you may also specify "exclude_prepended:false" to allow any prepended items to be fetched along with other results anyway.
exclude_appended optionalboolean
True to specifically exclude all appended menus from the fetched results. This is false by default - even if "unique:true" is specified - so that results are returned in the proper order.
unique optionalboolean
True to remove duplicates from each of the resulting lists (prepended, fetched, appended, and items), although there may be duplicates between the prepended, fetched, and appended lists. The "items" list will include objects in the order in which they appear - with prepended items first, then fetched items, then appended items.
max_size optionalinteger
The maximum number of items to be included in the "items" list. If there are any prepended or appended items, this will automatically lower the "limit" to only fetch as many menus as needed. Note that this may also impact both the "page" and "total_pages" values in the resulting menus. In order to use pagination with a list loaded using "max_size" use "start" instead of "page" and "limit".
date_created_start optionalvalue
Only include menus with date_created greater than or equal to date_created_start. Remember that date_created will typically be the date that the menu was first published.
date_created_end optionalvalue
Only include menus with date_created less than or equal to date_created_end. Remember that date_created will typically be the date that the menu was first published.
start optionalinteger
Set the 1-based index of the first menu to fetch.
page optionalinteger
Used to automatically calculate the first menu to fetch based on both the "limit" and the 1-based "page" value. Defaults to 1, but is ignored if "start" is set.
limit optionalinteger
The maximum number of menus to fetch. Defaults to 10. Note that if "max_size" is defined, then "limit" may be automatically lowered even if specified separately.
sort_by optionalstring
Specify which property to sort the results by. Has no effect on prepended or appended menus. Options include:
  • date_created: the date each menu was first published. Unpublishing and republishing one resets date_created to the current date.
  • random: results will be returned in a random order, which prevents the page from being fast-cached. Setting cache_random:true overrides this behavior and allows the page to be fast-cached anyway.
  • name
  • title
  • url
  • browser_title
sort_direction optionalstring
asc or desc.
cache_random optionalboolean
True to allow the results to be cached when sort_by is "random".

Fetches a list of {{ menus }}.

{% profiles %}

{% profiles output_to_template? [[var, set, or assign]? variable]? output_to_template? = arguments %}
Parameters
output_to_template optionalflag
If included the {% profiles %} will be output directly to the template.
var, set, or assign optionalkeyword
Optional. Specify either "var", "set" or "assign" to change which scope this {% profiles %} is stored on. "var" is the default behavior.
variable optionalvariable
arguments requiredcollection
Key:value pairs. May use the variable arguments syntax.

Options

prepend optionallist
May be a single profile, a list of profiles, or the name or guid of one profile, to be included at the beginning of the profiles list.
append optionallist
May be a single profile, a list of profiles, or the name or guid of one profile, to be included at the end of the profiles list.
exclude optionallist
May be a single profile, a list of profiles, or the name or guid of one profile that should NOT be included in the fetched results. Has no effect on prepended or appended profiles.
exclude_prepended optionalboolean
True to specifically exclude all prepended profiles from the fetched results. If "unique:true" is specified this is the default behavior, although you may also specify "exclude_prepended:false" to allow any prepended items to be fetched along with other results anyway.
exclude_appended optionalboolean
True to specifically exclude all appended profiles from the fetched results. This is false by default - even if "unique:true" is specified - so that results are returned in the proper order.
unique optionalboolean
True to remove duplicates from each of the resulting lists (prepended, fetched, appended, and items), although there may be duplicates between the prepended, fetched, and appended lists. The "items" list will include objects in the order in which they appear - with prepended items first, then fetched items, then appended items.
max_size optionalinteger
The maximum number of items to be included in the "items" list. If there are any prepended or appended items, this will automatically lower the "limit" to only fetch as many profiles as needed. Note that this may also impact both the "page" and "total_pages" values in the resulting profiles. In order to use pagination with a list loaded using "max_size" use "start" instead of "page" and "limit".
filter optionalvalue
Only include profiles that match the given string filter
is_active optionalvalue
only include profiles that either are or are not active
is_blocked optionalvalue
Only include profiles that either are or are not blocked
query optionalvalue
Only include profiles whose settings match the given query. Profile queries share the same advanced syntax as datastore item queries, which may be reviewed at https://help.marketpath.com/liquid/advanced-datastore-queries
attributes optionalvalue
Only include profiles whose attributes match the given query. Profile queries share the same advanced syntax as datastore item queries, which may be reviewed at https://help.marketpath.com/liquid/advanced-datastore-queries
date_logged_in_start optionalvalue
Only include profiles with date_last_logged_in greater than or equal to date_logged_in_start
date_logged_in_end optionalvalue
Only include profiles with date_last_logged_in less than or equal to date_logged_in_end
date_created_start optionalvalue
Only include profiles with date_created greater than or equal to date_created_start. Remember that date_created will typically be the date that the profile was first published.
date_created_end optionalvalue
Only include profiles with date_created less than or equal to date_created_end. Remember that date_created will typically be the date that the profile was first published.
start optionalinteger
Set the 1-based index of the first profile to fetch.
page optionalinteger
Used to automatically calculate the first profile to fetch based on both the "limit" and the 1-based "page" value. Defaults to 1, but is ignored if "start" is set.
limit optionalinteger
The maximum number of profiles to fetch. Defaults to 10. Note that if "max_size" is defined, then "limit" may be automatically lowered even if specified separately.
sort_by optionalstring
Specify which property to sort the results by. Has no effect on prepended or appended profiles. By default, results will be sorted by relevance if there is a filter string and date_created desc (newest first) if not. Options include:
  • relevance: only applies when there is a filter string. When sorting by relevance sort_direction is ignored.
  • date_created: the date each profile was first published. Unpublishing and republishing one resets date_created to the current date.
  • random: results will be returned in a random order, which prevents the page from being fast-cached. Setting cache_random:true overrides this behavior and allows the page to be fast-cached anyway.
  • name
  • title
  • url
  • browser_title
sort_direction optionalstring
asc or desc.
cache_random optionalboolean
True to allow the results to be cached when sort_by is "random".

Fetches a list of {{ profiles }}.

{% snippets %}

{% snippets output_to_template? [[var, set, or assign]? variable]? output_to_template? = arguments %}
Parameters
output_to_template optionalflag
If included the {% snippets %} will be output directly to the template.
var, set, or assign optionalkeyword
Optional. Specify either "var", "set" or "assign" to change which scope this {% snippets %} is stored on. "var" is the default behavior.
variable optionalvariable
arguments requiredcollection
Key:value pairs. May use the variable arguments syntax.

Options

prepend optionallist
May be a single snippet, a list of snippets, or the name or guid of one snippet, to be included at the beginning of the snippets list.
append optionallist
May be a single snippet, a list of snippets, or the name or guid of one snippet, to be included at the end of the snippets list.
exclude optionallist
May be a single snippet, a list of snippets, or the name or guid of one snippet that should NOT be included in the fetched results. Has no effect on prepended or appended snippets.
exclude_prepended optionalboolean
True to specifically exclude all prepended snippets from the fetched results. If "unique:true" is specified this is the default behavior, although you may also specify "exclude_prepended:false" to allow any prepended items to be fetched along with other results anyway.
exclude_appended optionalboolean
True to specifically exclude all appended snippets from the fetched results. This is false by default - even if "unique:true" is specified - so that results are returned in the proper order.
unique optionalboolean
True to remove duplicates from each of the resulting lists (prepended, fetched, appended, and items), although there may be duplicates between the prepended, fetched, and appended lists. The "items" list will include objects in the order in which they appear - with prepended items first, then fetched items, then appended items.
max_size optionalinteger
The maximum number of items to be included in the "items" list. If there are any prepended or appended items, this will automatically lower the "limit" to only fetch as many snippets as needed. Note that this may also impact both the "page" and "total_pages" values in the resulting snippets. In order to use pagination with a list loaded using "max_size" use "start" instead of "page" and "limit".
tag optionalvalue
May include multiple tags. Only include snippets with one of the given tags
folder optionalvalue
May include multiple folders. Only include snippets with one of the given folders
date_created_start optionalvalue
Only include snippets with date_created greater than or equal to date_created_start. Remember that date_created will typically be the date that the snippet was first published.
date_created_end optionalvalue
Only include snippets with date_created less than or equal to date_created_end. Remember that date_created will typically be the date that the snippet was first published.
start optionalinteger
Set the 1-based index of the first snippet to fetch.
page optionalinteger
Used to automatically calculate the first snippet to fetch based on both the "limit" and the 1-based "page" value. Defaults to 1, but is ignored if "start" is set.
limit optionalinteger
The maximum number of snippets to fetch. Defaults to 10. Note that if "max_size" is defined, then "limit" may be automatically lowered even if specified separately.
sort_by optionalstring
Specify which property to sort the results by. Has no effect on prepended or appended snippets. Options include:
  • date_created: the date each snippet was first published. Unpublishing and republishing one resets date_created to the current date.
  • random: results will be returned in a random order, which prevents the page from being fast-cached. Setting cache_random:true overrides this behavior and allows the page to be fast-cached anyway.
  • name
  • title
  • url
  • browser_title
sort_direction optionalstring
asc or desc.
cache_random optionalboolean
True to allow the results to be cached when sort_by is "random".

Fetches a list of {{ snippets }}.

{% stylesheets %}

{% stylesheets output_to_template? [[var, set, or assign]? variable]? output_to_template? = arguments %}
Parameters
output_to_template optionalflag
If included the {% stylesheets %} will be output directly to the template.
var, set, or assign optionalkeyword
Optional. Specify either "var", "set" or "assign" to change which scope this {% stylesheets %} is stored on. "var" is the default behavior.
variable optionalvariable
arguments requiredcollection
Key:value pairs. May use the variable arguments syntax.

Options

prepend optionallist
May be a single stylesheet, a list of stylesheets, or the name or guid of one stylesheet, to be included at the beginning of the stylesheets list.
append optionallist
May be a single stylesheet, a list of stylesheets, or the name or guid of one stylesheet, to be included at the end of the stylesheets list.
exclude optionallist
May be a single stylesheet, a list of stylesheets, or the name or guid of one stylesheet that should NOT be included in the fetched results. Has no effect on prepended or appended stylesheets.
exclude_prepended optionalboolean
True to specifically exclude all prepended stylesheets from the fetched results. If "unique:true" is specified this is the default behavior, although you may also specify "exclude_prepended:false" to allow any prepended items to be fetched along with other results anyway.
exclude_appended optionalboolean
True to specifically exclude all appended stylesheets from the fetched results. This is false by default - even if "unique:true" is specified - so that results are returned in the proper order.
unique optionalboolean
True to remove duplicates from each of the resulting lists (prepended, fetched, appended, and items), although there may be duplicates between the prepended, fetched, and appended lists. The "items" list will include objects in the order in which they appear - with prepended items first, then fetched items, then appended items.
max_size optionalinteger
The maximum number of items to be included in the "items" list. If there are any prepended or appended items, this will automatically lower the "limit" to only fetch as many stylesheets as needed. Note that this may also impact both the "page" and "total_pages" values in the resulting stylesheets. In order to use pagination with a list loaded using "max_size" use "start" instead of "page" and "limit".
stylesheet_type optionalvalue
Only include stylesheets of the given type
compiled optionalvalue
Only include stylesheets that either are or are not compiled
is_legacy optionalvalue
only include stylesheets that are marked as using a legacy compiler
path optionalvalue
May include multiple paths. Only include stylesheets with one of the given paths (excluding child paths)
date_created_start optionalvalue
Only include stylesheets with date_created greater than or equal to date_created_start. Remember that date_created will typically be the date that the stylesheet was first published.
date_created_end optionalvalue
Only include stylesheets with date_created less than or equal to date_created_end. Remember that date_created will typically be the date that the stylesheet was first published.
start optionalinteger
Set the 1-based index of the first stylesheet to fetch.
page optionalinteger
Used to automatically calculate the first stylesheet to fetch based on both the "limit" and the 1-based "page" value. Defaults to 1, but is ignored if "start" is set.
limit optionalinteger
The maximum number of stylesheets to fetch. Defaults to 10. Note that if "max_size" is defined, then "limit" may be automatically lowered even if specified separately.
sort_by optionalstring
Specify which property to sort the results by. Has no effect on prepended or appended stylesheets. Options include:
  • date_created: the date each stylesheet was first published. Unpublishing and republishing one resets date_created to the current date.
  • random: results will be returned in a random order, which prevents the page from being fast-cached. Setting cache_random:true overrides this behavior and allows the page to be fast-cached anyway.
  • name
  • title
  • url
  • browser_title
sort_direction optionalstring
asc or desc.
cache_random optionalboolean
True to allow the results to be cached when sort_by is "random".

Fetches a list of {{ stylesheets }}.

{% tags %}

{% tags output_to_template? [[var, set, or assign]? variable]? output_to_template? = arguments %}
Parameters
output_to_template optionalflag
If included the {% tags %} will be output directly to the template.
var, set, or assign optionalkeyword
Optional. Specify either "var", "set" or "assign" to change which scope this {% tags %} is stored on. "var" is the default behavior.
variable optionalvariable
arguments requiredcollection
Key:value pairs. May use the variable arguments syntax.

Options

prepend optionallist
May be a single tag, a list of tags, or the name or guid of one tag, to be included at the beginning of the tags list.
append optionallist
May be a single tag, a list of tags, or the name or guid of one tag, to be included at the end of the tags list.
exclude optionallist
May be a single tag, a list of tags, or the name or guid of one tag that should NOT be included in the fetched results. Has no effect on prepended or appended tags.
exclude_prepended optionalboolean
True to specifically exclude all prepended tags from the fetched results. If "unique:true" is specified this is the default behavior, although you may also specify "exclude_prepended:false" to allow any prepended items to be fetched along with other results anyway.
exclude_appended optionalboolean
True to specifically exclude all appended tags from the fetched results. This is false by default - even if "unique:true" is specified - so that results are returned in the proper order.
unique optionalboolean
True to remove duplicates from each of the resulting lists (prepended, fetched, appended, and items), although there may be duplicates between the prepended, fetched, and appended lists. The "items" list will include objects in the order in which they appear - with prepended items first, then fetched items, then appended items.
max_size optionalinteger
The maximum number of items to be included in the "items" list. If there are any prepended or appended items, this will automatically lower the "limit" to only fetch as many tags as needed. Note that this may also impact both the "page" and "total_pages" values in the resulting tags. In order to use pagination with a list loaded using "max_size" use "start" instead of "page" and "limit".
filter optionalvalue
Only include tags that match the given string filter
author optionalvalue
May include multiple authors. Only include tags with one of the given authors
folder optionalvalue
May include multiple folders. Only include tags with one of the given folders
date_created_start optionalvalue
Only include tags with date_created greater than or equal to date_created_start. Remember that date_created will typically be the date that the tag was first published.
date_created_end optionalvalue
Only include tags with date_created less than or equal to date_created_end. Remember that date_created will typically be the date that the tag was first published.
has_url optionalboolean
If true, only return tags that have a URL. If false, only return tags that do NOT have a URL.
template optionalobject
Only return tags with one of these templates. May be a single template, a list of templates, or the name or guid of a template to filter the results by.
include_in_search optionalboolean
True or false to only return tags whose include_in_search property matches the provided value.
domain_name optionalobject
Only return tags from the given domain.
start optionalinteger
Set the 1-based index of the first tag to fetch.
page optionalinteger
Used to automatically calculate the first tag to fetch based on both the "limit" and the 1-based "page" value. Defaults to 1, but is ignored if "start" is set.
limit optionalinteger
The maximum number of tags to fetch. Defaults to 10. Note that if "max_size" is defined, then "limit" may be automatically lowered even if specified separately.
sort_by optionalstring
Specify which property to sort the results by. Has no effect on prepended or appended tags. By default, results will be sorted by relevance if there is a filter string and date_created desc (newest first) if not. Options include:
  • relevance: only applies when there is a filter string. When sorting by relevance sort_direction is ignored.
  • date_created: the date each tag was first published. Unpublishing and republishing one resets date_created to the current date.
  • random: results will be returned in a random order, which prevents the page from being fast-cached. Setting cache_random:true overrides this behavior and allows the page to be fast-cached anyway.
  • name
  • title
  • url
  • browser_title
sort_direction optionalstring
asc or desc.
cache_random optionalboolean
True to allow the results to be cached when sort_by is "random".

Fetches a list of {{ tags }}.

{% templates %}

{% templates output_to_template? [[var, set, or assign]? variable]? output_to_template? = arguments %}
Parameters
output_to_template optionalflag
If included the {% templates %} will be output directly to the template.
var, set, or assign optionalkeyword
Optional. Specify either "var", "set" or "assign" to change which scope this {% templates %} is stored on. "var" is the default behavior.
variable optionalvariable
arguments requiredcollection
Key:value pairs. May use the variable arguments syntax.

Options

prepend optionallist
May be a single template, a list of templates, or the name or guid of one template, to be included at the beginning of the templates list.
append optionallist
May be a single template, a list of templates, or the name or guid of one template, to be included at the end of the templates list.
exclude optionallist
May be a single template, a list of templates, or the name or guid of one template that should NOT be included in the fetched results. Has no effect on prepended or appended templates.
exclude_prepended optionalboolean
True to specifically exclude all prepended templates from the fetched results. If "unique:true" is specified this is the default behavior, although you may also specify "exclude_prepended:false" to allow any prepended items to be fetched along with other results anyway.
exclude_appended optionalboolean
True to specifically exclude all appended templates from the fetched results. This is false by default - even if "unique:true" is specified - so that results are returned in the proper order.
unique optionalboolean
True to remove duplicates from each of the resulting lists (prepended, fetched, appended, and items), although there may be duplicates between the prepended, fetched, and appended lists. The "items" list will include objects in the order in which they appear - with prepended items first, then fetched items, then appended items.
max_size optionalinteger
The maximum number of items to be included in the "items" list. If there are any prepended or appended items, this will automatically lower the "limit" to only fetch as many templates as needed. Note that this may also impact both the "page" and "total_pages" values in the resulting templates. In order to use pagination with a list loaded using "max_size" use "start" instead of "page" and "limit".
template_type optionalvalue
Only include templates with the given template type (page, partial, form, or gallery)
path optionalvalue
May include multiple paths. Only include templates with one of the given paths (excluding child paths)
date_created_start optionalvalue
Only include templates with date_created greater than or equal to date_created_start. Remember that date_created will typically be the date that the template was first published.
date_created_end optionalvalue
Only include templates with date_created less than or equal to date_created_end. Remember that date_created will typically be the date that the template was first published.
start optionalinteger
Set the 1-based index of the first template to fetch.
page optionalinteger
Used to automatically calculate the first template to fetch based on both the "limit" and the 1-based "page" value. Defaults to 1, but is ignored if "start" is set.
limit optionalinteger
The maximum number of templates to fetch. Defaults to 10. Note that if "max_size" is defined, then "limit" may be automatically lowered even if specified separately.
sort_by optionalstring
Specify which property to sort the results by. Has no effect on prepended or appended templates. Options include:
  • date_created: the date each template was first published. Unpublishing and republishing one resets date_created to the current date.
  • random: results will be returned in a random order, which prevents the page from being fast-cached. Setting cache_random:true overrides this behavior and allows the page to be fast-cached anyway.
  • name
  • title
  • url
  • browser_title
sort_direction optionalstring
asc or desc.
cache_random optionalboolean
True to allow the results to be cached when sort_by is "random".

Fetches a list of {{ templates }}.

{% search %}

Fetches a list of pages on the site that match the given searchterm. Live results are pages whose indexed fields match; they are not a search of compiled HTML.

{% search output_to_template? [[var, set, or assign]? variable]? output_to_template? = searchterm attributes %}
Parameters
output_to_template optionalflag
If included the {% search %} will be output directly to the template.
var, set, or assign optionalkeyword
Optional. Specify either "var", "set" or "assign" to change which scope this {% search %} is stored on. "var" is the default behavior.
variable optionalvariable
output_to_template optionalflag
If included the {% search %} will be output directly to the template.
searchterm requiredstring
attributes optionaldictionary
Key:value pairs with unique keys. May use the variable arguments syntax.

Options

type optionalvalue
Entity type to search (e.g., article, image)
domain_name optionalvalue
Limit the search to a specific domain name
limit optionalvalue
Max results to return (integer). Must be between 1 and 1000. Defaults to 25
start optionalvalue
Zero-based index to start from (integer)
page optionalvalue
Page number for paged results (integer), starting from 1

Live search indexes pages (and other URL-bearing entities that are included in search), not the rendered template. Shared chrome such as headers and footers is not searchable. Only HTML, text, and textarea custom fields are indexed; other field types are not. CMS Search This Site also matches other object types and internal names. Pages with Include in Search turned off are omitted from live search.

Example Search only blog post entities by a query parameterFilter blog post entities using a query parameter (e.g. tag or search term) and output the results.
Liquid
{% search output_to_template request.query_params.q type:blog_post %}
Example Search with query parameters and limit result lengthUse query parameters to drive search and limit the number of results returned.
Liquid
{%- var page = request.query_params.p | default:1 -%}
{%- var limit = request.query_params.l | default:25 -%}
{%- search set results request.query_params.q page:page limit:limit -%}