Common Template Tags
Last updated Oct 19th, 2026 | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn moreThis page lists the most commonly used MODX Revolution tags as an aid to anyone converting HTML/CSS layouts into MODX Templates. These are frequently referred to as "tags" or "placeholders" (and sometimes "template variables"), so we mention those terms here as an aid to searching, although technically speaking they are not placeholders or template variables: they are MODX tags. Yes, it can be confusing for the newcomer, so just remember that there are different flavors of these tags, each with its own purpose and name. Placeholders are set in code and are displayed with placeholder tags. Template Variables are extra resource content fields created by the user. They can be thought of as custom fields. Neither placeholders, not template variables are pre-set by the MODX core.
Default Resource Content Field Tags¶
In MODX Revolution, each page will always have the following content fields that you can use when constructing your templates. Except for the Resource ID and the parent field, they are all supplied by the user when editing the resource and may be empty if the user did not fill them in:
| Tag | Description | Example Usage |
|---|---|---|
[[*id]] |
the Resource ID of the page (set by MODX when the page is created. | Often used in conjunction with the link syntax, e.g. <a href="[[~[[*id]]]]">Bookmark this page!</a> |
[[*pagetitle]] |
the Title of the page. | <title>[[*pagetitle]]</title> |
[[*longtitle]] |
the Long Title of the page | <h1>[[*longtitle]]</h1> |
[[*alias]] |
the page alias. | Used to construct the URL of the page |
[[*description]] |
the page Description | <meta name="description" content="[[*description]]"/> |
[[*introtext]] |
the Introductory Text field (a.k.a. the summary). | Often used by Snippets to summarize posts, e.g. <div id="summary">[[*introtext]]</div> |
[[*parent]] |
the ID of the parent page (if any). Set by MODX when the page is created. Can be altered by the user. | Often used in conjunction with the link syntax, e.g. <a href="[[~[[*parent]]]]">Up to parent page</a> |
[[*menutitle]] |
the Title used when the page appears in menus. | Most frequently used by Snippets such as Wayfinder or pdoMenu when dynamically constructing menus |
[[*content]] |
the content of the page. | <body>[[*content]]</body> |
Other Common Tags¶
These tags represent system settings, which are editable under the System menu -> System Settings.
| Tag | Description | Example Usage |
|---|---|---|
[[++site_url]] |
Contains the URL for your site, e.g. http://www.yoursite.com/. This is a config value, not a system setting — it comes from MODX_SITE_URL in config.inc.php and is not editable in the manager |
With many CMS's that rely on Apache rewrites, it's common practice to include a base tag in your HTML head: <base href="[[++site_url]]" /> |
[[++site_name]] |
Name of the site. A system setting, editable in the manager. | <title>[[++site_name]] | [[*pagetitle]]</title> |
[[++site_start]] |
Contains the ID of the page designated as your "home" page. | Often used in conjunction with the link syntax, e.g. <a id="logo" href="[[~[[++site_start]]]]">Home</a> |
[[$chunk]] |
This references a chunk by name. Chunks are any bit of reusable content. | Common chunks might be for header or footer |
[[~link]] |
Use this syntax to build links to pages by referencing their unique id (visible in parentheses next to the page's name in the resource tree). These links will not break if pages are moved or renamed. You can change the generated scheme of the link by passing the &scheme parameter (see link_tag_scheme) | <a id="logo" href="[[~1]]">Home</a> |
[[%translated_message]] |
Use lexicon tags to localize messages. | [[!%setting_emailsender? &topic=`setting` &namespace=`core` &language=`en`]] |
All Tags¶
As you increase your understanding of how MODX templates work, you'll want to have at your disposal the complete list of available content fields. Here is the complete list of all tags, gleaned from this blog post.
| Tag | Data Type | Description | Example Usage |
|---|---|---|---|
[[*alias]] |
text | Alias | Normally, you will use the id to generate the URL, e.g. <a href="[[~[[*id]]]]">Click Here!</a>, but this lets you print out the alias parameter. |
[[*cacheable]] |
int 0/1 | Cacheable | |
[[*class_key]] |
varchar | Class Key of the Resource, e.g. MODX\Revolution\modDocument | |
[[*content]] |
text | Resource Content | |
[[*content_type]] |
int | Content Type | |
[[*createdon]] |
date | Created On date, e.g. 2011-04-14 20:40:50, often used in conjunction with the strtotime output filter | [[*createdon:strtotime:date=`%a %b %e, %Y`]] See Date Formats. |
[[*createdby]] |
int | Created By User ID Number | |
[[*deleted]] |
int 0/1 | Deleted | |
[[*deletedby]] |
int | Deleted By User ID Number | |
[[*deletedon]] |
date | Date of Deletions | [[*deletedon:strtotime:date=`%a %b %e, %Y`]] See Date Formats. |
[[*description]] |
text | Description | |
[[*editedon]] |
date | Edited On date, e.g. 2011-04-18 09:06:08 | [[*editedon:strtotime:date=`%a %b %e, %Y`]] See Date Formats. |
[[*editedby]] |
int | Edited By User ID number | |
[[*hidemenu]] |
int 0/1 | Hide From Menus; this attribute is read by many Snippets, e.g. WayFinder | |
[[*id]] |
int | Resource ID | Used frequently to generate links to this page. |
[[*introtext]] |
text | Summary | |
[[*isfolder]] |
int 0/1 | Container | |
[[*link_attributes]] |
text | Link attributes; these are inserted automatically when you use the [[~123]] syntax |
|
[[*longtitle]] |
text | Long Title | |
[[*menuindex]] |
int | Menu Index | |
[[*menutitle]] |
text | Menu Title | |
[[*pagetitle]] |
text | Page Title | |
[[*parent]] |
int | Parent Resource | |
[[*pub_date]] |
date ---Publish Date | ||
[[*published]] |
int 0/1 | Published | |
[[*publishedby]] |
int | Published By User ID Number | |
[[*publishedon]] |
date | Published On | [[*publishedon:strtotime:date=`%a %b %e, %Y`]] See Date Formats. |
[[*richtext]] |
int 0/1 | Rich Text | |
[[*searchable]] |
int 0/1 | Searchable | |
[[*template]] |
int | Template ID number | |
[[*unpub_date]] |
date – Unpublish Date | [[*unpub_date:strtotime:date=`%a %b %e, %Y`]] See Date Formats. |
|
[[*uri_override]] |
int 0/1 | Freeze URI | |
[[*uri]] |
string | URI |
Just to clarify on pub_date – it's only set when the user sets a future date for publication in the Publish On field. And when the doc is actually published, it's zeroed out. The publishedon field always contains the most recent date that the resource changed from unpublished to published (or the date a new doc was saved with Publish checked).
See Also¶
- Date Formats: shows how to format date fields.
- Resources
- Content Types
- Named Anchor
- Static Resource
- Symlink
- Using Resource Symlinks
- Weblink
- Templates
- Chunks
- Using Snippets
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn more










