How can I escape MODX tags in a Code field?

This is a common question for people writing documentation for MODX or MODX tools. When you use a Code field you can preprocess the entered value in such a way that you don't have to manually escape MODX tags. 

For your Code field, on the properties tab, simply enable the encode content option. MODX tags will be escaped with their html entities to avoid processing.

Please see the following tutorial for step-by-step instructions on showing code samples with ContentBlocks: Displaying (MODX) Code

Still need help? Send us an email Send us an email