MODx Advanced FAQ
If you don't find an answer here, ask for help in the appropriate section of the MODX Forums. If they might have a bearing on your problem, be sure to include your browser version, MODX version, hosting service, Apache version, PHP version, and MySQL version.
What's the difference between site_url and base_url when used in tags?
Your template should always include a base href statement using the site_url:
MODX Evolution: <base href="[(site_url)]" />
MODX Revolution: <base href="[[++site_url]]" />
What's the proper way to create a link to a page at my site?
MODX Evolution [~##~]
MODX Revolution [[~##]]
(where ## is the document ID of the document being linked to. Examples:
MODX Evolution: <a href="[~12~]">Link to document 12</a>
MODX Revolution: <a href="[[~12]]">Link to document 12</a>
If you would like a fully qualified link for SEO purposes, you can use this form instead:
MODX Evolution: <a href="[(site_url)][~12~]">Link to document 12</a>
MODX Revolution: <a href = "[[++site_url]][[~12]]">Link to document 12</a>
I can't get Friendly URLs to work in XAMPP. What am I doing wrong?
LoadModule rewrite_module modules/mod_rewrite.so
How can I get the document ID of the current document in a plugin?
MODX Revolution: $docid = $modx->resource->get('id');
What other params are available to plugins attached to system events?
What causes this error? Fatal error: Allowed memory size of 33554432 bytes exhausted
Another possibility is a snippet such as Ditto, that pulls content from a page that has the same Ditto tag on it (or in the template attached to it).
Finally, if your memory limit is 32M or less, Ditto and some other snippets can exhaust it in their normal operation. Try increasing the memory_limit setting in php.ini.
I have extra back-slashes showing up in my code. Where are they coming from?
How can I send $_GET arguments in a URL from a snippet in Revolution?
$url = $modx->makeUrl($id, '', 'paramName=value');
How did you create this marvelous FAQ?
If you have the book and would like to download the code, you can find it here.
If you have the book and would like to see the updates and corrections page, you can find it here.
MODX: The Official Guide is 772 pages long and goes far beyond this web site in explaining beginning and advanced MODX techniques. It includes detailed information on:
- Installing MODX
- How MODX Works
- Working with MODX resources and Elements
- Using Git with MODX
- Using common MODX add-on components like SPForm, Login, getResources, and FormIt
- MODX security Permissions
- Customizing the MODX Manager
- Using Form Customization
- Creating Transport Packages
- MODX and xPDO object methods
- MODX System Events
- Using PHP with MODX
Go here for more information about the book.
Thank you for visiting BobsGuides.com
— Bob Ray