We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28215
    • 4,149 Posts
    This is an auto-generated topic for CodeMirror 1.1.0-rc1 by splittingred.

    Brief Description:

    CodeMirror integration for MODx Revolution. Get custom syntax highlighting in your Elements.
    New in 1.1.0

    • Integrated into OnFileEditFormPrerender, now can use in file editing
    • Added extra checks and options for ensuring changes get saved

    New in 1.0.1

    • Now auto-assigns CodeMirror to which_element_editor setting


      shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
      • 17422
      • 225 Posts
      i just install codeMirror,

      but when i want modify a file in Files tree, ex index.php or other, nothing appears,

      i uninstall codeMirror and it’s good.

      codeMirror works just for Elements ? not for files

      thanks for your response.

      Laurent

      Modx revo pl
      Apache
      Mysql
        • 20287
        • 1 Posts
        First off, fantastic extra, I have it installed on all my sites. I saw your code comment about debating whether to use the OnRichText events. I think the functionality should be included, but let the user decide to turn on the system events if they want. Either way, still a great extra, I’ll just keep modding it if you don’t feel it fits.

          • 36404
          • 307 Posts
          hi,

          i must say CodeMirror is really awesome, i end coding my pages directly in MODx without working first in my beloved ultraedit smiley (that auto indent feature, simply wow !)

          it’s so awesome that i would like to know if it’s possible to get it as an input option for TVs... for example, chosing htmlarea or richtext will display... the richtext in the ressource edition, would it be possible to overwrite this behavior having CodeMirror for htmlareas, keeping tinyMCE for other richtext TV like content ?
          That would be great for custom js or css to add in the head with TVs

          thanks for any suggestion smiley

          Have swing
            réfléchir avant d'agir
            • 36404
            • 307 Posts
            hi again,

            something else i’m wondering, CodeMirror Highlighting being so beautiful, would it be possible to use it as a code highlighter on the front end for pre/code areas ?

            again, thanks for any idea or track for this smiley

            have swing
              réfléchir avant d'agir
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              I’m sure it would; it’s just some javascript. How to do it would be best discovered at their site. However, I’ve easily embedded TinyMCE in a front-end form just by looking at how it’s done for a Rich Text TV. The question is, would this be the best way to do this, since it is designed specifically for textarea input fields.

              Of course, there are other scripts that will do this...

              http://www.webdesignbooth.com/9-useful-javascript-syntax-highlighting-scripts/
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 17499 ☆ A M B ☆
                • 872 Posts
                CodeMirror is not a syntax highlighter but a code editor. It’s not really the good tool to do this kind of job.

                You can use GeSHI which is a syntax highlighter, with no needs for javascript and already works with MODx Revolution as package: http://modxcms.com/extras/package/680
                  • 36404
                  • 307 Posts
                  hi,

                  thanks both of you for you answers.

                  Well, i know quite well the other code highlighting solutions but was just thinking that having codeMirror installed it would have been great to use it for both front and back end.
                  Now you’re right as it is more designed to replace textarea it may be a funny idea smiley

                  well, now i’ve just got to understand how to use it for custom TV texterea input
                  currently i’m putting all my old own website content into revo and, as it mainly a js classes/plugins sharing website, i’ve a lot of pages with custom js and css in the head part.
                  I use two TVs for this and it works great, but to be sure to have them clean i write those custom js and css in utltraedit before putting them in a textarea and it would be really handy to have codeMirror there smiley

                  thanks again for answering

                  have swing
                    réfléchir avant d'agir
                    • 17016
                    • 138 Posts
                    Does anybody know if it is possible to make the codemirror-window bigger?

                    Letti