The automatic_markup object and methods that set document metadata, robots, timezone, and injection flags.
{{ automatic_markup }} is the reserved root-scope object for the title, meta tags, scripts, and styles the CMS will inject after the template renders. The methods on this page change that state. {% toggle_automatic_markup %} turns injection on or off for the head, the body, and the Edit Page link.
{{ automatic_markup }}
The automatic_markup object contains information about the data and markup that will be added to the page automatically after it is rendered by the template.
The page title as it is currently configured to be output as part of the automatic markup. Defaults to {{ entity.browser_title }} but may be set to another value using {% set_title %}
The page meta description as it is currently configured to be output as part of the automatic markup. Defaults to {{ entity.meta_description | default:site.default_meta_description }} but may be set to another value using {% set_description %}
The page robots meta information as it is currently configured to be output as part of the automatic markup. Defaults to {{ entity.meta_robots }} but may be set to another value using {% set_robots %}
The page's canonical url meta information as it is currently configured to be output as part of the automatic markup. Defaults to {{ entity.canonical_url }} but may be set to another value using {% set_canonical_url %}
The favicon for the page as it is currently configured to be output as part of the automatic markup. Does NOT have a default value but may be set using {% set_favicon %}
True if the template is currently configured to output automatic markup in the head of the current page. Defaults to true but may be changed using {% toggle_automatic_markup %}
True if the template is currently configured to output automatic markup in the body of the current page. Defaults to true but may be changed using {% toggle_automatic_markup %}
True if the template is currently configured to output extra markup (HTML and javascript) as a result of being loaded through the preview UI in Marketpath CMS
True if the template is currently configured to output the "Edit Page" link to the current page. Note that this depends on a number of factors, the most notable of which are the site configuration and the user being logged in to Marketpath CMS at the same time. Can be changed using {% toggle_automatic_markup %}, but only if the pre-requisites for showing the edit link have been met
The markup that will be output to the end of the head of the current page. This includes the stylesheets and javascript that were added to the header using {% add_stylesheet %} and {% add_javascript %}
The markup that will be output to the end of the body of the current page. This includes the stylesheets and javascript that were added to the body using {% add_stylesheet position:body %} and {% add_javascript position:body %}
The list of stylesheet linked_src objects that should be output to the document body as part of the automatic markup (most styles should be added to the head and not the body except in rare edge-cases)
One script or stylesheet queued for output. The header_scripts, body_scripts, stylesheets, and body_stylesheets lists on {{ automatic_markup }} hold linked_src objects.
Updates the browser title to "[site.name] | [entity.browser_title]" by capturing the new browser title in a variable and then setting the title to the variable.
In this contrived example, the meta description will be updated to "[site.name] says [entity.meta_description]" if the entity meta_description is valid.
set_description in a single expression using filters
This example will have the same result as the previous example. It is more concise at the expense of being less flexible.
{% set_favicon %}
Sets the URL to the favicon for the current page, which is output by default as part of an HTML page's {{ automatic_markup }}.
{% set_favicon value %}Parameters
valuerequiredexpression
Should resolve either to the URL of the favicon for the current page (starting with "https://", "http://", or "//") or the image object (by name, guid, or direct reference) May use liquid filters.
This simply changes the URL for the favicon meta tag in the head of the HTML response. It does not take into consideration alternate meta tags and it does not change the response to requests for /favicon.ico The current favicon URL is available at {{ automatic_markup.favicon }}
ExampleHow to use the set_favicon method
Set favicon from the name of an image
Liquid
{% set_favicon "favicon.ico" %}
Sets the favicon to the image with the name "favicon.ico".
The current robots meta directive is available at {{ automatic_markup.robots }}
ExampleHow to use the {% set_robots %} tagUse the set_robots tag to set the robots meta directive (e.g. for indexing or noindex).
No index, no follow
Liquid
{%- set_robots "noindex,nofollow" -%}
Instructs search engines not to index the page or follow its links.
Unset the robots meta directive
Liquid
{% set_robots null %} will do the same thing as {% set_robots '' %}
If set_robots is used with a null value or empty string then the robots meta directive will not be output in the HTML.
Set from a variable
Liquid
{%- var meta_instructions = "" -%}
{%- if noindex %}{% set meta_instructions = meta_instructions | append:',noindex' %}{% endif -%}
{%- if nofollow %}{% set meta_instructions = meta_instructions | append:',nofollow' %}{% endif -%}
{%- set_robots meta_instructions | slice: 1 | default:'all' -%}
The meta instructions are dynamically generated based on the presence of the noindex and nofollow variables. If one or the other are present then it will start with a comma which much be removed, and if neither are present than the default value of 'all' will be used, which instructs search engines that there are no restrictions for indexing or serving.
{% set_timezone %}
Sets the default timezone to use when rendering dates and times on the page that do not already have a separate timezone configured.
{% set_timezone value %}Parameters
valuerequiredexpression
Should evaluate to a timezone identifier. For the best result, use a well-known timezone ids (eg: "UTC"), the GMT offset (eg: "GMT+5:00"), the full timezone name (eg: "Pacific Standard TIme"), or the full city identifier (eg: "Europe/Amsterdam") May use liquid filters.
Some dates and times do not use the default timezone and will not be affected by this method.
ExampleMany ways to use the date filterYou can use the date filter either to create a date object or to format a date as a string.
Liquid
{% set_timezone 'UTC' %}
create a date object
Liquid
{{ "2009-09-09" | date }}
Output
9/9/2009 12:00:00 AM
Liquid
{{ "2009-09-09" | date: "D" }}
Output
Wednesday, September 9, 2009
Liquid
{{ 0 | date: "D" }}
Output
Thursday, January 1, 1970
Liquid
{{ 1756239994 | date: "D" }}
Output
Tuesday, August 26, 2025
Defaults to the current date
Liquid
{{"now" | date}}
Output
2009-09-09T00:00:00.0000000+00:00 (or whatever the current date is)
format a date as a string
Liquid
{{request.date | date: "d"}}
Output
9/9/2009
Liquid
{{request.date | date: "D"}}
Output
Sunday, September 9, 2009
Liquid
{{request.date | date: "o"}}
Output
9/9/2009 12:00:00 AM
Liquid
{{request.date | date: "MMMM dd, yyyy"}}
Output
September 09, 2009
ExampleSet the request timezoneSet the request timezone from a string (e.g. IANA zone) so date/time output uses that zone.
Enables or disables the automatic markup at the page level
{% toggle_automatic_markup flags %}Parameters
flagsoptionallist
One or more values. May use the variable arguments syntax. Options that control which markup is enabled or disabled
Options
enableoptionalvalue
Turns the automatic markup on for the specified options
disableoptionalvalue
Turns the automatic markup off for the specified options (default)
headeroptionalvalue
Turns the header markup on or off
bodyoptionalvalue
Turns the body markup on or off
edit_pageoptionalvalue
Turns the "Edit Page" button on or off (if applicable)
alloptionalvalue
Turns all of the automatic markup on or off (default if neither header, body, or edit_page are specified)
Automatic markup typically only applies to HTML pages. You cannot enable the "Edit Page" button if it would not be displayed on the site by default (ie: either if it has been disabled in the site settings, if it is being viewed from the preview site, or if the current user is not signed in to Marketpath CMS.