2

Is it possible to add a syntax highlighter in Tridion rich text box format so that user can convert some specific lines of code in nicely wrapped syntax using experience manager. I am looking for something just like this rft where in I can provide some syntax and highlight it by clicking "{}" symbol while editing the content in Experience manager.

1
  • A few of the open source syntax highlighters (Prettify and similar) just need a wrapping class or escaped markup wrapped in a <pre>. So the extension might be simple when editing in an RTF, but "pretty" when rendered. Commented Feb 16, 2015 at 21:55

1 Answer 1

3

It should be possible, but you'd need to build it as a GUI extension yourself.

It would probably involve the extension to add the button, code to deal with the selection of text (or none) which would add some kind of markup. Probably some FormatAreaStyles.css modifications to display it differently within the RTF, and then some template code to actually render it correctly on the page when published / previewed.

It would be quite an undertaking and you may run into limitations in the process. I've never done anything like that, so I cannot say if it's possible to do everything you want; but you can certainly get close. It would just be a ton of effort, so you should carefully consider if it's worth the investment.

(If you do it, I hope you release it online so others can benefit too! :))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.