We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42562
    • 1,145 Posts
    If you try this implementation of Ace and CodeMirror, you WILL never never look back again. It is beyond beautiful, intuitive, highly extensible right from from one chunk (no digging around looking for config).
    It uses pure lovely CDN, that means you will always be updated - for real!
    Receive the full offering that official Ace and CodeMirror give you - no strings!
    You'll soon forget you were coding using a web page... smiley

    Use with any RTE like a boss. View Source Code of RTE (use twAceEditor.js and twCodeMirror.js)
    Switch between CodeMirror and Ace (back and forth) like a godfather.
    Switch syntax and editor height like you are an IDE architect - complete control!
    30-40 themes to enjoy
    Change font-size ...
    Your life just got changed!
    Install http://modx.com/extras/package/tinymcewrapper

    Excerpt from https://forums.modx.com/thread/97694/support-comments-for-tinymcewrapper?page=24#dis-post-541131
    UPDATED TinymceWrapperCodeMirror chunk (includes emmet) to function like its fraternal twin below.

    ADDED TinymceWrapperAce chunk (includes emmet)
    0. Ace up any fabled textarea within MODX... including quick edit/ create... beautiful and awesome, easy to customize!
    1. Flawlessly auto detect resource language by content_type (mime), or set to fixed.
    2. Auto detect elements according to static source extension, or set to fixed.
    3. Auto detect file language according to file extension - or even in quick edit modal.
    4. Change language on the fly while editing anything.
    5. Go full screen.
    6. Deactivate individual textareas at pleasure.
    7. Use with RTE - well, you can, and why not?
    8. Out of the box, Ace comes with lint for the major languages if not all, and a powerful set of keyboard control./
    0-7 is applicable to TinymceWrapperCodeMirror
    [ed. note: donshakespeare last edited this post 7 years, 11 months ago.]
      TinymceWrapper: Complete back/frontend content solution.
      Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
      5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
      • 52778
      • 1 Posts
      Hi,

      I installed ACE 1.6.5-pl on modx-2.5.1-pl. But after install, then I was unable to create new document (by clicking icon document or plus sign in left panel). The screen is white. If inspected using Developer Tool on browser it says HTTP error 500. I already change System Setting for editor 'which_editor' to 'Ace' and 'use_editor' to 'No' and other combination value, but still no luck. Am I missing something? Please help.

      Thank you.
        • 1061
        • 81 Posts
        How did you do that, change settings if you are unable to use manager, if I'm correctly understand you.

        P.S. and please check your log file
          • 52884
          • 25 Posts
          I have an issue with ACE when using the "assets_url" setting in a context.

          It seems that ACE is using that setting to load it's files. Setting the namespace assets url has no effect.
          How can I tell Ace to use the correct path for the files? "Correct" means the default one in this scenario.

          https://www.managerdomain.tld/ctx/assets/setting/components/ace/ace/mode-css.js
          https://www.managerdomain.tld/ctx/assets/setting/components/ace/ace/mode-javascript.js

          etc.

          edit: Even if I set the system setting ace.assets_url to the correct path, there are still 4 files loaded via ace.min.js with the wrong assets_url retreived from the ctx setting:

          .../components/ace/ace/theme-chrome.js
          .../components/ace/ace/mode-css.js
          .../components/ace/emmet/emmet.js
          .../components/ace/ace/mode-javascript.js [ed. note: balihoo last edited this post 7 years, 4 months ago.]
            • 52884
            • 25 Posts
            I was able to fix this and would like to suggest a fix for the next update. Error handling could be useful here as well, so that ace.assets_url is only used when not empty, otherwise it should fall back to assets_url.

            In assets/components/ace/modx.texteditor.js I changed:

            In line 238:

            //var acePath = MODx.config['assets_url'] + 'components/ace/ace'; // old one
            var acePath = MODx.config['ace.assets_url'] + 'ace'; // new one



            In line 305:

            // net.loadScript(MODx.config['assets_url'] + 'emmet/emmet.js', function() { // old one
            net.loadScript(MODx.config['ace.assets_url'] + 'emmet/emmet.js', function() { // new one
            


            In line 859:

            // url: MODx.config['assets_url'] + 'completions.php', // old one
            url: MODx.config['ace.assets_url'] + 'completions.php', // new one
            

              • 46073
              • 65 Posts
              Since updating to ACE 1.6.5, in Revo 2.5.5, the ACE editor has stopped working within chunks, snippets, templates, etc. It still works perfectly in the static files like .css and .js files.

              Anyone else?
                • 38666
                • 98 Posts
                Spotted this in the installation instructions, it worked for me
                just set system option use_editor to false (global usage)
                  Give a man the answer, and he’ll only have a temporary solution. Teach him the principles that led you to that answer, and he will be able to create his own solutions in the future.
                  • 18367
                  • 834 Posts
                  How do you turn it on, make it work?

                  I mean how do you actually make it work as a code editor?

                  All it seems to do is make the code multicoloured. There's no editing functionality, menu or toolbar or anything. At least not in my installation.

                  Now it's not working at all. seems to have a mind of it's own

                  [ed. note: markg last edited this post 7 years ago.]
                    Content Creator and Copywriter
                    • 18367
                    • 834 Posts
                    Anyone?

                    Is it supposed to have a menu bar, is it supposed to do copy and replace, is it supposed to do word wrapping?

                    If so where are all these features hidden or how do you activate them?





                      Content Creator and Copywriter
                      • 45778
                      • 75 Posts
                      Hello,

                      Is anyone planning to update the MODX port of Ace to the latest version so that it can handle PHP 7 syntax?