Hi everyone!
I’ve seen few websites built with Modx and some have tutorials with lots of code chunks posted. I was wondering if anyone can telm how to do that. How can i post html/css/php or even Modx code chunks on my pages?
Roadie
I found it but it doesn’t work.
Still strips the tags and I couldn’t find any tutorials or examples.
Roadie
I use the FixedPre plugin (available for both Evolution and Revolution).
Hi Shaun,
I have read through your brief instruction and the installation notes on the Syntaxhighlighter but still struggling to understand how to implement this into my MODx revolution deployment. Would you mind give me a bit more details on how it can be setup please?
Appreciate your help.
Regards.
Johnmen
Hi Shaun,
Just an update, I managed to get the SyntaxHighlighter working on my site. However the way to implement it is a bit dumb, as I don't know how to use snippet or chunk, rather I directly entered all the required scripts and CSS files into my website template, then manually added the <pre></pre> tag to all the codes that I wanted to highlight.
I do have another question if you don't mind:
Is there any more automated way to add the <pre></pre> tag to codes that I wanted to highlight? I am using TinyMCE rich text editor and each time I needed to bring up the HTML source code for the document then manually add the tags to the right places. It is manual and error prone.
Regards.
Johnmen
There is an installable SyntaxHighlighter package for Revolution now (with both a snippet and a plugin), but TBH, the way you did it is faster and more efficient.
http://bobsguides.com/syntaxhighlighter-tutorial.html
I don't think there's any way to make TinyMCE do what you want because the pre tags have to contain the appropriate "brush: brushalias" directive. It would be a nice addition to TinyMCE if it let you select text to highlight and gave you a choice of brushes, but most of us don't use TinyMCE at all for editing (except by clients).