modxcms / fred

The friendly front-end editor for visual, drag-and-drop content building in MODX CMS
https://fred.modx.com
MIT License
59 stars 25 forks source link

Built-in code blocks #389

Open sottwell opened 3 years ago

sottwell commented 3 years ago

It is not possible to have code blocks containing MODX tags. Even custom TinyMCE configurations with FixedPre don't work in many cases. For one thing, TinyMCE still inserts line breaks wherever it thinks they should be, and content visibility varies from Fred views to visitor view.

There is the possibility that a TinyMCE plugin using Prism could work; ContentBlocks has a code input block using Ace and Prism available. https://docs.modmore.com/en/ContentBlocks/v1.x/Tips_Tricks/Displaying_MODX_Code.html

Since articles and tutorials about MODX need to be able to display code containing MODX tags without those tags being processed, it would be nice to have such a feature. As things stand now, I'm having pages with such code use a non-Fred template so I can use FixedPre, or else use screen capture images of the code.

sottwell commented 3 years ago

Bruno17 has provided an elegant and very easy to use plugin and javascript combination for this, but it still would be an appropriate feature to have built-in.