CSS editor on textarea fields
This is an open discussion with 3 replies, filed under General.
Search
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: https://github.com/andrewminton/codemirror/blob/master/assets/js/init.js#L3
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.
Hi,
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.