Is there a way I could enable CSS syntax highlighting inside the textarea of a section?

I know there is an extension that enables CodeMirror highlighting but it seems to work only with utilities and pages textarea in the backend.

Thank you.

Codemirror is just some JS that targets a specific textarea based on being in the admin side of the CMS, I'm sure there's a way of allowing it to target textareas.. it would involve a modified extension and it might target every textarea, so there may need to be some hacking to assign the textarea you wish to provide code highlighting a specific class name in order for codemirror to target it...

That's off the top of my head with blurry eyes and no coffee.

See this line in my fork:

If you could assign a class to specific textareas you want to allow highlighting.. you could adjust this to target it...

Or give your textarea a specific name attribute and target that by altering the JS line I've linked to.

Thank you. I will see how best to go about giving the textarea a CSS class. This is in the backend.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details