MODX CMS Development
Expert guidance for MODX Revolution websites.
Tag Syntax Quick Reference
[[SnippetName]] Cached snippet
[[!SnippetName]] Uncached snippet (per-request)
[[$ChunkName]] Chunk (HTML)
[[*fieldname]] Resource field (pagetitle, content, alias, etc.)
[[++settingKey]] System/Context setting
[[~resourceId]] Link to resource
[[+placeholder]] Placeholder from snippet/chunk
Output Modifiers
[[*pagetitle:striptags:limit=`60`]]
[[*field:default=`fallback value`]]
[[+date:strtotime:date=`%B %d, %Y`]]
[[*content:nl2br]]
Parameters
[[SnippetName? ¶m=`value` &other=`[[*field]]`]]
[[$ChunkName? &title=`[[*pagetitle]]` &class=`card`]]
Critical Syntax Rules
- Resource fields use asterisk:
[[*pagetitle]], [[*content]], [[*alias]]
- Placeholders use plus:
[[+title]], [[+idx]], [[+wrapper]]
- TV names must be single words:
heroImage not hero_image or hero-image
- Uncached (
!) only when dynamic: session data, user input, time-based
- Nested tags resolve inner-first:
[[Snippet? &id=[[*parent]]]]
Core Extras Stack
| Extra |
Purpose |
| pdoTools |
High-performance listings (pdoResources, pdoMenu, pdoCrumbs) |
| MIGX |
Repeatable content fields (FAQs, testimonials, galleries) |
| ClientConfig |
Site-wide settings (contact, social, branding) |
| SEO Suite |
Meta titles, descriptions, redirects |
| Image+ |
Visual image cropping with aspect ratio control |
| FormIt |
Form processing with validation and hooks |
| modAI |
AI-powered content generation |
Common Patterns
pdoResources Listing
[[pdoResources?
&parents=`[[*id]]`
&limit=`12`
&tpl=`tplCard`
&includeTVs=`heroImage,introText`
&processTVs=`1`
&tvPrefix=``
&sortby=`menuindex`
&sortdir=`ASC`
]]
pdoMenu Navigation
[[pdoMenu?
&parents=`0`
&level=`2`
&tplOuter=`@INLINE <ul class="nav">[[+wrapper]]</ul>`
&tpl=`@INLINE <li><a href="[[+link]]">[[+menutitle]]</a>[[+wrapper]]</li>`
&tplParentRow=`@INLINE <li class="has-children"><a href="[[+link]]">[[+menutitle]]</a>[[+wrapper]]</li>`
&tplInner=`@INLINE <ul class="dropdown">[[+wrapper]]</ul>`
]]
Image+ Snippet
[[ImagePlus? &tvname=`heroImage` &options=`w=800&h=450&zc=1`]]
With template chunk:
[[ImagePlus? &tvname=`heroImage` &type=`tpl` &tpl=`tplImage` &options=`w=800`]]
In pdoResources tpl (requires &docid):
[[ImagePlus? &tvname=`heroImage` &docid=`[[+id]]` &options=`w=400&h=225&zc=1`]]
ClientConfig Usage
[[++brand]] Company name
[[++phone-main]] Primary phone
[[++email-main]] Contact email
[[++social-facebook]] Facebook URL
[[++primary-color]] Brand color hex
Conditional Output
[[*heroImage:notempty=`<img src="[[*heroImage]]" alt="[[*pagetitle]]">`]]
[[++gtm-id:notempty=`<!-- GTM Code -->`]]
File Organization
Templates Chunks Pattern
Keep templates minimal; decompose into cached chunks:
<!-- Template -->
[[$head]]
[[$header]]
<main>
[[$hero]]
[[$section.content]]
[[$cta]]
</main>
[[$footer]]
[[$scripts]]
Reference Files
For detailed information, read the appropriate reference:
- references/naming-conventions.md: Element naming standards (templates, chunks, TVs, settings)
- references/syntax.md: Complete tag syntax, modifiers, caching rules
- references/extras.md: pdoTools, MIGX, FormIt, Image+ patterns
- references/clientconfig.md: Settings structure and groups
- references/schema.md: JSON-LD structured data implementation
- references/ModxTransfer.md: ModxTransfer snippet for importing/exporting elements and resources
Caching Strategy
| Element |
Default |
When Uncached |
| Chunks |
Cached |
Never (use snippet wrapper) |
| Snippets |
Cached |
User-specific, form data, real-time |
| TVs |
Cached |
Rarely |
| Settings |
Cached |
Never |
Performance Tips
- Use
pdoTools over getResources for listings
- Cache snippets by default; benchmark before uncaching
- Limit
&includeTVs to only needed TVs
- Use
&tvPrefix= `` to avoid placeholder prefix issues
- Index database columns used in
&where clauses
Troubleshooting
| Issue |
Solution |
| Changes not showing |
Clear cache: Site Clear Cache |
| Blank output |
Check tag syntax, especially backticks and brackets |
| TV not rendering |
Verify TV assigned to template, check name (single word) |
| pdoMenu empty |
Check &parents, resource hidemenu setting |
| Image+ not working |
Ensure pThumb installed, TV output type set to Image+ |
| Snippet error |
Check Error Log: Manager → Reports → Error Log |
1---2name: modx-cms3description: Expert-level MODX Revolution CMS development, templating, and content management. Use this skill when building MODX websites, creating templates/chunks/snippets, configuring extras (pdoTools, MIGX, ClientConfig, SEO Suite, Image+, FormIt), writing MODX tag syntax, implementing schema markup, or troubleshooting MODX issues. Triggers include "MODX", "pdoResources", "pdoMenu", "MIGX", "ClientConfig", "FormIt", "Image+", "ImagePlus", "chunks", "snippets", "TVs", "template variables", or any MODX CMS development task.4---56# MODX CMS Development78Expert guidance for MODX Revolution websites.910## Tag Syntax Quick Reference1112```13[[SnippetName]] Cached snippet14[[!SnippetName]] Uncached snippet (per-request)15[[$ChunkName]] Chunk (HTML)16[[*fieldname]] Resource field (pagetitle, content, alias, etc.)17[[++settingKey]] System/Context setting18[[~resourceId]] Link to resource19[[+placeholder]] Placeholder from snippet/chunk20```2122### Output Modifiers23```24[[*pagetitle:striptags:limit=`60`]]25[[*field:default=`fallback value`]]26[[+date:strtotime:date=`%B %d, %Y`]]27[[*content:nl2br]]28```2930### Parameters31```32[[SnippetName? ¶m=`value` &other=`[[*field]]`]]33[[$ChunkName? &title=`[[*pagetitle]]` &class=`card`]]34```3536## Critical Syntax Rules37381. **Resource fields use asterisk**: `[[*pagetitle]]`, `[[*content]]`, `[[*alias]]`392. **Placeholders use plus**: `[[+title]]`, `[[+idx]]`, `[[+wrapper]]`403. **TV names must be single words**: `heroImage` not `hero_image` or `hero-image`414. **Uncached (`!`) only when dynamic**: session data, user input, time-based425. **Nested tags resolve inner-first**: `[[Snippet? &id=`[[*parent]]`]]`4344## Core Extras Stack4546| Extra | Purpose |47|-------|---------|48| pdoTools | High-performance listings (pdoResources, pdoMenu, pdoCrumbs) |49| MIGX | Repeatable content fields (FAQs, testimonials, galleries) |50| ClientConfig | Site-wide settings (contact, social, branding) |51| SEO Suite | Meta titles, descriptions, redirects |52| Image+ | Visual image cropping with aspect ratio control |53| FormIt | Form processing with validation and hooks |54| modAI | AI-powered content generation |5556## Common Patterns5758### pdoResources Listing59```60[[pdoResources?61 &parents=`[[*id]]`62 &limit=`12`63 &tpl=`tplCard`64 &includeTVs=`heroImage,introText`65 &processTVs=`1`66 &tvPrefix=``67 &sortby=`menuindex`68 &sortdir=`ASC`69]]70```7172### pdoMenu Navigation73```74[[pdoMenu?75 &parents=`0`76 &level=`2`77 &tplOuter=`@INLINE <ul class="nav">[[+wrapper]]</ul>`78 &tpl=`@INLINE <li><a href="[[+link]]">[[+menutitle]]</a>[[+wrapper]]</li>`79 &tplParentRow=`@INLINE <li class="has-children"><a href="[[+link]]">[[+menutitle]]</a>[[+wrapper]]</li>`80 &tplInner=`@INLINE <ul class="dropdown">[[+wrapper]]</ul>`81]]82```8384### Image+ Snippet85```86[[ImagePlus? &tvname=`heroImage` &options=`w=800&h=450&zc=1`]]87```8889With template chunk:90```91[[ImagePlus? &tvname=`heroImage` &type=`tpl` &tpl=`tplImage` &options=`w=800`]]92```9394In pdoResources tpl (requires `&docid`):95```96[[ImagePlus? &tvname=`heroImage` &docid=`[[+id]]` &options=`w=400&h=225&zc=1`]]97```9899### ClientConfig Usage100```101[[++brand]] Company name102[[++phone-main]] Primary phone103[[++email-main]] Contact email104[[++social-facebook]] Facebook URL105[[++primary-color]] Brand color hex106```107108### Conditional Output109```110[[*heroImage:notempty=`<img src="[[*heroImage]]" alt="[[*pagetitle]]">`]]111[[++gtm-id:notempty=`<!-- GTM Code -->`]]112```113114## File Organization115116### Templates Chunks Pattern117Keep templates minimal; decompose into cached chunks:118119```120<!-- Template -->121[[$head]]122[[$header]]123<main>124 [[$hero]]125 [[$section.content]]126 [[$cta]]127</main>128[[$footer]]129[[$scripts]]130```131132## Reference Files133134For detailed information, read the appropriate reference:135136- **[references/naming-conventions.md](references/naming-conventions.md)**: Element naming standards (templates, chunks, TVs, settings)137- **[references/syntax.md](references/syntax.md)**: Complete tag syntax, modifiers, caching rules138- **[references/extras.md](references/extras.md)**: pdoTools, MIGX, FormIt, Image+ patterns139- **[references/clientconfig.md](references/clientconfig.md)**: Settings structure and groups140- **[references/schema.md](references/schema.md)**: JSON-LD structured data implementation141- **[references/ModxTransfer.md](references/ModxTransfer.md)**: ModxTransfer snippet for importing/exporting elements and resources142143## Caching Strategy144145| Element | Default | When Uncached |146|---------|---------|---------------|147| Chunks | Cached | Never (use snippet wrapper) |148| Snippets | Cached | User-specific, form data, real-time |149| TVs | Cached | Rarely |150| Settings | Cached | Never |151152## Performance Tips1531541. Use `pdoTools` over `getResources` for listings1552. Cache snippets by default; benchmark before uncaching1563. Limit `&includeTVs` to only needed TVs1574. Use `&tvPrefix=` `` to avoid placeholder prefix issues1585. Index database columns used in `&where` clauses159160## Troubleshooting161162| Issue | Solution |163|-------|----------|164| Changes not showing | Clear cache: Site Clear Cache |165| Blank output | Check tag syntax, especially backticks and brackets |166| TV not rendering | Verify TV assigned to template, check name (single word) |167| pdoMenu empty | Check `&parents`, resource `hidemenu` setting |168| Image+ not working | Ensure pThumb installed, TV output type set to Image+ |169| Snippet error | Check Error Log: Manager → Reports → Error Log |