-
- 1,039 Posts
Hi,
perhaps some of the developers can give me a quick hint. If I don´t want the document parser to render MODx tags in <pre> or <code> or some self defined tags, how would be the best practice? Or how is it realised here on the modx documentation page? On my german site I want to create some tutorials and also in the integrated forum the parser doesn´t allow to write MODx tags like snippet calls and so on. Of course it´s possible to insert an HTML comment, but that is not very usable.
So, how is this made on the documentation site or what do I have to change in the document.parser.inc.php?
Thx in advance,
Marc
-
- 96 Posts
Cute solution. You can turn your hack into a plugin, by making the first substitution on an early stage of the parsing process (for example, in response to a OnLoadWebDocument event), and the second one after the snippets have been evaluated, for example capturing the OnWebPagePrerender event.
-
- 1,193 Posts
a simple solution is to use HTML comments to break up the brackets in you snippet call. that way it wont be parsed.
an example you ask! ok:
[<!-- -->[DropMenu]<!-- -->]
would be displayed on the page as [[DropMenu]], but would not be parsed by MODx
-sD-
-
- 4,213 Posts
Please create a thread for your plugin in "in development" forums and once it’s tested post to the resource repository.. Thanks a lot for contributing! Nice job!
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
-
- 55 Posts
I don’t know a lot about MODx internals, but presumably you are simply saving all the content enclosed within <pre></pre> tags, and restoring it just before it’s sent to the web client. If so, then I see no reason why it won’t work. But we do need to use some tag other than <pre>. Otherwise you still won’t be able to mention [!Wayfinder!] in the middle of a normal paragraph.
Either way, yours or mine, we seem to be copying large amounts of data. It could end up slowing down the system a lot.
Rahul