FixedPre Plugin Tutorial
If you use this extra and like it, please consider donating. The suggested donation for this extra is $5.00, but any amount you want to give is fine (really). For a one-time donation of $50.00 you can use all of my non-premium extras with a clear conscience.
This plugin is for use with MODX Revolution. FixedPre can be used to display MODX tags and PHP code in a MODX document. Simply wrap the tags or code in <fixedpre> tags. FixedPre is a Revolution version of Rahul Dhesi's plugin for MODX Evolution.
Installing FixedPre for MODX Revolution
Go to Extras -> Installer on the main menu in the MODX Manager and click on the "Download Extras" button. That will take you to the Revolution Repository. Put FixedPre in the search box and press Enter. Click on the "Download" button. When the download has finished, click on the "Back to Package Manager" button. That should bring you back to your Package Management grid. Click on the "Install" button next to FixedPre." The FixedPre plugin should now be installed.
FixedPre Sections
On the rendered web page, the <fixedpre> tags will be removed. Tag-related characters ([
, ]
, <
, >
, &
) will be replaced with HTML entities.
Note that as of version 1.0.2, FixedPre tags are no longer replaced with <span class="fxp"</span> tags in order to make FixedPre play nice with SyntaxHighlighter.
If you depended on the span tags to format code and tags inside a regular paragraph (in other words, not in a <pre> section), you can add them back outside the fixedpre tags:
<span class="fxp"><fixedpre>Something</fixedpre></span>
For conversion on a live site, you can make the change above before updating FixedPre. You'll have nested span tags until you update FixedPre, but it shouldn't affect the display.
If you are presenting PHP or HTML/XML code, you can put the <fixedpre> tags inside <pre></pre> tags.
Important: If you're using SyntaxHighlighter, the <fixedpre> tags must be inside the <pre> tags.
My book, MODX: The Official Guide - Digital Edition is now available here. The paper version of the book may still be available from Amazon.
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