As you become familiar with using tags within Modx you will begin to see the scalability of the CMS. There are many tags that can be used with Modx Revolution, but you will find that some types of tags will be more often used than others. The following article defines the types of tags and lists some of the more common tags within Modx.
Modx Revolution has two major groups of tags: Content Elements and Content Tags. Content element tags are tags that directly represent elements on the web page being generated by Modx. They correspond to Elements that can be used by Modx. The Content Tags represent values and settings that can be modified within Modx. Here are a few tables showing the major types of tags used:
Template variables | [[*templatevar]] | A custom field used by Modx |
---|---|---|
Chunks | [[$chunkname]] | Text that can be re-used throughout the site (e.g. Contact Us information) |
Snippets | [[snippet]] | As per the Modx Revolution definition, snippets are short reusable pieces of computer code |
Resource fields | [[*field]] | Can represent different fields within a resource. For example: [[*pagetitle]] |
These are the commonly uses 5 major types of content tags. The following table lists the different tags, the format of the tag, and a short description of each tag type:
Placeholders | [[+placeholder]] | Placeholders are generally text markers that indicate where text will be inserted at the tag on a page or template |
---|---|---|
Links | [[~link]] | Link tags are used to represent weblinks to a page. Example: <a id="logo" href="/help/[[~1]]">Home</a> |
System Settings | [[++system_setting]] | Tag enables you add Modx System specific settings. For example, you can define email system settings that change an existing Modx system setting |
Language | [[%language_string_key]] | Allows you to specify language on a page or template |
Comment | [[-comment text]] | Tag used to place a comment in the page or template |
The following table of tags is straight from the Modx Revolution documentation, but does not list ALL of the tags available. This is simply a summary list of commonly used tags in an effort to clearly list the tag types and provide a summary reference for these often used tags.
Default Resource Content Field Tags
Resource ID tag | [[*id]] | Resource ID is a number assigned by Modx when the resource is created. Example usage: <a href="/help/[[~[[*id]]]]">Mark this page </a> |
---|---|---|
Title tag | [[*pagetitle]] | The title of the resource being created. Example: <title>[[*pagetitle]]</title> |
Long title tag | [[*longtitle]] | Long title of the resource. Example code: <h1>[[*longtitle]]</h1> |
Alias | [[*alias]] | Page alias. Used when forming the page URL with friendly URLs. Example: http://thewebsite.com/smootheasyURL ('smootheasyURL' would be the alias for the URL) |
Description | [[*description]] | Description of the page. Example: <meta name = "description" content="[[*descriptiion]]"/> |
Introtext | [[*introtext]] | Introductory text for the page. Example: <div id="summary">[[*introtext]]</div> |
Parent | [[*parent]] | ID of the parent page (Modx sets this value) |
Menutitle | [[*menutitle]] | Title used by the page as it appears in a menu system |
Content | [[*content]] | Content of the page. Example: <body>[[*content]]</body> |
Common System Tags
Site URL | [[++site_url]] | System tag that contains the website URL. Example: <base href="/help/[[++site_url]]" /> |
---|---|---|
Site Name | [[++site_name]] | Contains the name of the site. Example: <title>[[++site_name]]</title> |
Start Page for website | [[++site_start]] | Identifies the home page of your website. Example: <a id="logo" href="/help/[[~[[++site_start]]]]">Home</a> |
The format used by System tags in Modx Revolution will always start with "[[++" . Each of these settings can be found in the Modx back end interface under System>System Settings.
There are many other tags that are used by Modx. As you gain experience in using Modx, your knowledge of the available tags will grow. Using these tags within the Modx framework will help to build a much more robust, and flexible website. If you wish to see an example of a tag being used within the Modx website, please go to: How to use a Chunk Tag within Modx.
Email: | support@WebHostingHub.com | Ticket: | Submit a Support Ticket |
---|---|---|---|
Call: | 757-416-6627 | Chat: | Click To Chat Now |
We value your feedback!
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
new! - Enter your name and email address above and we will post your feedback in the comments on this page!