We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36516
    • 179 Posts
    I've been playing around quite a bit just now and I'm more confused than ever. With:

    'activateAceOrCodeMirrorOnNewResource'
    'activateAceOrCodeMirrorOnRichText'
    'useAceOrCodeMirrorEveryWhere'


    all disabled, I've been trying quick edits of various items throughout the site (templates, chunks), from the dashboard, from a resource edit page, a collection child create page, etc., and Ace seems to be available completely randomly through the "Edit with Ace" button in the bottom left corner of the quick edit popup. My current situation is actually close to ideal, excepting the cases where the 'Edit with Ace' fails to appear. Sometimes I even get 'Edit with TinyMCE' *and* 'Edit with Ace' buttons, which is fantastic. It just doesn't happen very often and there doesn't appear to be a pattern I can discern.

    Anyway, I've had a thought about all this and I've realised that your most likely response to my query above about being able to switch from TinyMCE to Ace editor will be something like "why would you want to do that?", which I suppose isn't entirely unreasonable, especially for a site intended for the uninitiated to be able to manage. But in any case I should make it clear that often one needs to edit the source code because Tiny is too restricting, or lacks the ability to set certain CSS classes, or achieve more complex layouts.

    As I mentioned above, if I disable TinyMCE using that tickbox (which I've actually disabled because with <> it doesn't seem necessary, and it's a little untidy) it reverts to plain text which reveals code, and in that case why not use Ace? Could Ace/Coremirror not become the fallback when Tiny is disabled?
      • 42562
      • 1,145 Posts
      FIXED CRITICAL ERROR MENTIONED IN...
      https://forums.modx.com/thread/97694/support-comments-for-tinymcewrapper?page=25#dis-post-542347

      Please revert to https://cdn.tinymce.com/4/tinymce.min.js
      update [[++assets_url]]components/tinymcewrapper/tinymceplugins/modxMagicHoverLink.js
      with https://github.com/donShakespeare/modxMagicHoverLink
        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.
        • 42562
        • 1,145 Posts
        RE: Dave Smith

        Thanks for the feedback.

        I wonder if you have found the little plus sign the side of each property in the plugin? I have managed to cough out what my mind deemed coherent at the time of composition.
        "activate..." turns on/off the code editor completely.
        When "on" then you can "use..." said editor here and there.

        Things to note
        on = code editor's CDN js file can be loaded into the MODX Manager page by whatever calls or "uses..." it.

        Because of common sense, the CDN files do not load always.

        The code editors are primarily for Resource full pages and Elements and Files.

        useAceOrCodeMirrorEveryWhere
        Experimental - Fires at OnManagerPageInit. Works Manager-wide. No need to be editing a MODX resource or element to load Ace or CodeMirror. You can be at the Dashboard or CMP to use Code Editor- comes in handy when doing Quick Update/Create outside of Resource and elements/files. This option respects useAceOrCodeMirrorOnResources and useAceOrCodeMirrorOnElementsFiles

        If a resource/element does not load any code editor CDN, useAceOrCodeMirrorEveryWhere will prove quite useless (even to Quick Edit). As described, useAceOrCodeMirrorEveryWhere will work outside Resources and Elements and Files.

        New Resources in Collections
        You did everything right.
        The "experimental" useAceOrCodeMirrorEveryWhere does not cover the rather rare way Collections creates new resources. They have no $id = 0 parameter.
        But this is non-issue, as this is covered already in my update.

        Replace line ~670 of TW plugin
        if (isset($_GET["a"],$_GET["id"]) && $_GET["id"] == 0 && strpos($_GET["a"], $newResource) !== false) {

        with:
        if (isset($_GET["a"]) && strpos($_GET["a"], $newResource) !== false) {


        The so-called Holy Grail
        As I mentioned above, if I disable TinyMCE using that tickbox (which I've actually disabled because with <> it doesn't seem necessary, and it's a little untidy) it reverts to plain text which reveals code, and in that case why not use Ace? Could Ace/CodeMirror not become the fallback when Tiny is disabled?
        I disabled pursuit of this feature because I was waiting for someone to request it. In the olden days people developed an attachment for the hideous textarea. I think that bond is about to be severed.

        And what is a little untidy about my tickbox? Draw me a picture of what you'd rather see ... then I might consider changing it

        Cheers
          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.
        • Hi Don,
          I'd prefer to work with the native MODX media browser. I go to plugin settings, set autoFileBrowser to modxNativeBrowser. That's all to it, right? Now, when I open the Media Browser, the image thumbs and preview are gone, see Screenshot. Any ideas how to fix?
          Cheers,
          Brigitte
            Brigitte Bornemann - Accessibility Consultant, Web Designer - Hamburg / Munich, Germany.
            http://www.bit-informationsdesign.de
          • Next problem: OK-Button in media browser does not show, i.e. shows for a split second and then goes away. See screenshot in previous post.
              Brigitte Bornemann - Accessibility Consultant, Web Designer - Hamburg / Munich, Germany.
              http://www.bit-informationsdesign.de
              • 42562
              • 1,145 Posts
              RE: BrigitteB

              Thumbs Issue: is most probably a cache problem - I can't think of any other solution.

              OK-Button: Because the native browser is notorious and a pain in the nose, I have to hide the button - because the buttons do not work and are as such useless. The window closes automatically upon selection of an item.

              To avoid this less-than-aesthetic behaviour, please set modxNativeBrowserQuirkMode to yes for a smoother experience.

              Cheers
                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.
              • Don, I tried the caching idea. Deleted the core/cache folder, made a fresh install of TW, set autoFileBrowser to modxNativeBrowser. But again, when I open the media browser, there are no thumbnails to view my images.
                Any further ideas?

                Thanks for your time
                Brigitte
                  Brigitte Bornemann - Accessibility Consultant, Web Designer - Hamburg / Munich, Germany.
                  http://www.bit-informationsdesign.de
                  • 42562
                  • 1,145 Posts
                  If using chrome, right-click anywhere on the Manager page... hit inspect element
                  Tell me if you see ny errors in red in the console .... missing files etc

                  Quetions:
                  Is this problem occurring when accessing MOD native file browser from a means other than TinyMCE?
                  The user doing the accessing, is this user an admin?

                  Are you viewing File Browser while using another context (AND) new domain
                    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.
                  • Hi Don,
                    thanks for asking.

                    Chrome Console says
                    ext-all.js:21 Uncaught TypeError: Cannot read property 'dom' of null
                    Failed to parse SourceMap: http://[mydomain]/manager/assets/modext/modx.jsgrps-min.js.map
                    Failed to parse SourceMap: http://[mydomain]/manager/templates/default/css/index-min.css.map

                    User is admin.
                    Context is web.
                    Thumbs problem occurs when opening the MODX file browser from topnav, and also from Tiny image- and link tools.

                    Hope this leads you somewhere smiley

                    Best,
                    Brigitte
                      Brigitte Bornemann - Accessibility Consultant, Web Designer - Hamburg / Munich, Germany.
                      http://www.bit-informationsdesign.de
                    • Next, I tried ResponsiveFileManager, which looks nice to me (not too many buttons ;-). Could not get it up and running. Here my issues:

                      • access to my non-admin user groups. In responsivefilemanagerConnector, I set "rfmUserGroups" to "Administrator,myEditors". No effect, my Editors get noAccessMessage Text.
                      • access to my media folder. I prefer it outside of assets/, like so:
                        "[[++base_path]]/media/". I set this value to "absolutePATHtoUploadFolder_modx". Wrong effect on ResponsiveFileManager: like before, I can view only folders under assets/, then when I pick an image for insert, the absolute path is wrong, like so: "[[++base_path]]/media/images/myimage.png", should be "[[++base_path]]/assets/images/myimage.png". Result: broken image in my resource.
                      Does this make sense to you?

                      Cheers,
                      Brigitte

                        Brigitte Bornemann - Accessibility Consultant, Web Designer - Hamburg / Munich, Germany.
                        http://www.bit-informationsdesign.de