I want to share some ModX template code I've made on my ModX site. I can paste the html in fine using <pre>
but the chunks, eg [[$footer]]
[[$header]]
and placeholders, eg [[*content]]
still display as ModX Placeholders meaning I see the contents of [[$header]]
rather than just the code.
Does anyone know I way I can display placeholder and chunk code/hooks within a ModX resource?
Here is the solution mentioned by okiyanet in more detail. Create a snippet convertModxTags
and place this code inside:
<?php
$output = str_replace('[[','[[',$input);
return $output;
Then call it in your template:
[[!convertModxTags?&input=`[[*content]]`]]
or
[[*content:convertModxTags]]