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
    FIXED!

    RE: BrigitteB
    The fault lay in a TinyMCE quirk which has not, strangely enough, been classified as a bug.

    It happens that the official CDN (or other CDNs) does not carry the lang files. WEIRD, super WEIRD!!!
    So, a mere language: 'de', will throw a 404 error in your browser

    You need this as well
    language_url: 'http://absolute/url/to/your/own/language/de.js',
    http://archive.tinymce.com/wiki.php/Configuration:language_url

    If using TinymceWrapper, put this file outside the official assets/components/tinymcewrapper/ to survive upgrades.

    In your case, I downloaded the file and placed it in tinymce_lang folder right outside tinymcewrapper.
    In this chunk ... TinymceWrapperCommonCode_suffix
    language: 'de',
    language_url: MODx.config.assets_url+'components/tinymce_lang/de.js',


    Already reported issue
    https://github.com/tinymce/tinymce/issues/2352#issuecomment-222235891

    Download language packs from:
    http://archive.tinymce.com/i18n/ [ed. note: donshakespeare last edited this post 7 years, 1 month 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.
    • Sweet :-D
      Thanks a lot, Don, for sorting this out.
        Brigitte Bornemann - Accessibility Consultant, Web Designer - Hamburg / Munich, Germany.
        http://www.bit-informationsdesign.de
        • 42562
        • 1,145 Posts
        Great it got fixed.

        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.
          • 42562
          • 1,145 Posts
          INCOMPATIBILITY ALERT

          TinyMCE users who also use my modxMagicHoverLink.js plugin

          TinyMCE 4.3.13 - June 8, 2016 update (https://www.tinymce.com/docs/changelog/) is completely incompatible with said plugin. Once you clear your browser's cache you will see what I am talking about - crash galore!
          To continue to use said plugin you must ​downgrade one notch​ (until I figure out the precise issue)
          From: https://cdn.tinymce.com/4/tinymce.min.js
          To: https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.3.12/tinymce.min.js

          If using TinymceWrapper :
          1. change CDN link in plugin's custom property set tinySrc
          2. or remove modxMagicHoverLink.js from TinymceWrapperCommonCode chunk
          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.
            • 36516
            • 179 Posts
            Hi Don. You'll be pleased to know I have yet another random problem that appears to have come from nowhere. I'm in a bit of a desperate situation at the moment, so while I've begun investigating I'm posting this now just in case you're available and able to help me out a bit.

            While not doing anything that could predictably affect TW, I suddenly find that even after reinstalling TW, and using the default properties, upon editing a resource the Description and Content fields have disappeared (their text areas are hidden and TW doesn't render).

            I usually disable TW for the Description field, and upon doing that the text area reappears, but Content is still gone. Strangely, if I disable the 'Introtext' field which is currently the only RTE field for which TW appears to be working perfectly, the Description field will then work with TW, even though Content still doesn't.

            It's as if TW will only render for one RTE field on the page, but not Description unless Introtext is disabled.

            Finally, my browser produces the error "Unable to get property 'body' of undefined or null reference" in the console upon page refresh.

            I'm at a loss as to what I could possible have done recently to so suddenly have broken this. The closest I've come to TW recently is to check for updates for installed extras, and view the changelog for the newer version of TW which at the time I didn't have installed. I decided not to install it because everything was working and I didn't fancy rocking the boat (the irony).

            I backed out without changing anything - I think - but today when I noticed the problem I went back into the package manager and found that TW reported as "not installed". I then decided to completely remove and reinstall to get the new version and start fresh. The remove process didn't seem to work properly; I had to do it a few times along with at least one "uninstall" to eventually get it removed from the packages list, and before the chunks, snippets and plugin would actually disappear from the element tree.

            I finally reinstalled fresh and left everything as default only to find that it was still broken!

            I'm running Modx 2.4.2, and starting to wonder if TW is still compatible.
              • 36516
              • 179 Posts
              Ok I might have found a workaround. Seems there's something wrong with 'modxMagicHoverLink' because when I comment out the following line from the bottom of 'TinymceWrapperCommonCode' it all starts working properly.

              modxMagicHoverLink: "[[++assets_url]]components/tinymcewrapper/tinymceplugins/modxMagicHoverLink.js",


              The issue I'm left with now, though, is that Ace doesn't seem to be kicking in for Quick Edit etc.
                • 36516
                • 179 Posts
                I might have failed to notice the "Edit with Ace" button. All seems well now.
                  • 36516
                  • 179 Posts
                  With 'useAceOrCodeMirrorEveryWhere' enabled, when I create a new child in a Collection all the property set settings seem to be ignored. All fields (descripton, introtext, content) are Ace'ed even though I've specifically disabled 'description' in the property set. Editing an existing child works fine; this problem only occurs while creating a new child, and specifically a child of a Collection, it seems.

                  My current workaround is to disable 'useAceOrCodeMirrorEveryWhere' which means I can't use it for Quick Create/Edit. For some reason this makes new Collection children behave normally. What's different about creating child resources in Collections!?

                  Also, when I click on the '<>' button in the MCE toolbar to get the Ace editor popup, is there any particular reason this window has a static size, and can't be maximised? When quick editing chunks etc. it works in a more flexible way. It also makes me wonder why I can't just switch any given field into the Ace editor mode without the need for a popup. The mode where the toolbar is replaced with Ace's own buttons in the top right corner, with the little flag to tell you which code highlighter is activated.
                    • 42562
                    • 1,145 Posts
                    RE: Dave Smith
                    Thanks for the feedback.

                    I think you missed the alert that went out just before post (scroll up a bit). I can also assure you that the issue is, this time, not of your doing smiley
                    https://forums.modx.com/thread/97694/support-comments-for-tinymcewrapper?page=25#dis-post-542347
                    To continue to use said plugin you must ​downgrade one notch​ (until I figure out the precise issue)
                    From: https://cdn.tinymce.com/4/tinymce.min.js
                    To: https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.3.12/tinymce.min.js

                    If using TinymceWrapper :
                    1. change CDN link in plugin's custom property set tinySrc
                    2. or remove modxMagicHoverLink.js from TinymceWrapperCommonCode chunk
                    Cheers!

                    #1
                    With 'useAceOrCodeMirrorEveryWhere' enabled, when I create a new child in a Collection all the property set settings seem to be ignored.
                    You will have noticed by now that Ace/CodeMirror have nothing to do with the TW plugin properties save for only two connections: their ignition and fancy theme dropdown (for mere convenience)
                    Find chunk TinymceWrapperAce preferably your own suffixed chunk...

                    Chunk Description
                    TinymceWrapperAce is a chunk to let any whoever dominate the initialization of the powerful Ace code editor.
                    This tiny config can work anywhere and with anything in MODX...
                    And the content ...
                    aceTextareasIDorCLASS = [
                      {
                        "name": "introtext",
                        "selector": "#modx-resource-introtext",
                        "mode": "html",
                        "wrap": "free",
                        "maxHeightLines": "textarea",
                      },
                      {
                        "name": "description",
                        "selector": "#modx-resource-description",
                        "mode": "html",
                        "wrap": "free",
                        "maxHeightLines": "textarea"
                      },
                    

                    #2
                    Creating new resources should not be different from creating other native MODX resources
                    Is the new child in Collections Rich Text enabled by default?

                    Please play with these options

                    activateAceOrCodeMirrorOnRichText
                    Prevent Ace or CodeMirror from ever firing when Rich Text is turned on for a particular resource. Respects activateAceOrCodeMirrorOnNewResource and system richtext_default
                    activateAceOrCodeMirrorOnNewResource
                    New Resources have the option of a code editor. Respects activateAceOrCodeMirrorOnRichText
                    newResources
                    If you set richtext_default in System Settings, new resources will have the RTE clicked automatically.
                    Do you want TinyMCE to load also, automatically, for the new resource?

                    #3
                    Also, when I click on the '<>' button in the MCE toolbar to get the Ace editor popup, is there any particular reason this window has a static size, and can't be maximised? When quick editing chunks etc. it works in a more flexible way. It also makes me wonder why I can't just switch any given field into the Ace editor mode without the need for a popup. The mode where the toolbar is replaced with Ace's own buttons in the top right corner, with the little flag to tell you which code highlighter is activated.

                    Note two things
                    1. TinymceWrapperAce chunk gives you awesome full-on kitchen-sink state-of-the-art never-been-seen-before implementation of Ace within MODX, as MODX. It enables you to transform your textareas: from resources, elements, files, you name it!
                    2. twAceEditor.js < > is a TinyMCE plugin that has absolutely nothing to do with MODX. Even WordPressers can use that plugin immediately! I designed this plugin to be light, for a start. In future, you might see those cute funtions (toolbar, maximize) that you are enjoying now in MODX.
                    It is designed to pop up but default (you can change the TinyMCE setting to inline), and not replace the existing content area, for many reasons many which I have now forgotten smiley
                    This is the full setting of how to tame this plugin:
                    https://github.com/donShakespeare/twAceEditor

                    Thanks for being an intelligent user, you highly encourage me not to fall into despair;)
                    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.
                      • 36516
                      • 179 Posts
                      Wow, I really must have missed your previous post by minutes. It says you posted an hour before I did, but I imagine it took me an hour to post mine, for reasons.

                      Here's a question: what's the difference between "useAce..." and "activateAce..."? The wording implies that one simply dictates that the *option* to edit using Ace is available, while the other actually triggers it by default.

                      I'm playing now, but as I explained before, with 'useAceOrCodeMirrorEveryWhere' enabled everything seems to work perfectly everywhere, with the singular exception of creating a new Collection child. Very odd.

                      I have several Collections now, and I've tried one with children set to Rich Text by default, and the other set to the default. Both produce the same result when creating a new child. I've got 'activateAceOrCodeMirrorOnNewResource' and 'activateAceOrCodeMirrorOnRichText' both disabled now, and to be honest I can't see what difference they make. Editing existing resources, Collection children included, works fine still. Creating new standalone resources works fine still.

                      I've also tried setting 'activateAceOrCodeMirror' to 'none' (blank) to see what happens. It seems to have the same effect as disabling 'useAceOrCodeMirrorEveryWhere', in that I can no longer use Ace for quick creating/editing.

                      For clarity I have attached a screenshot of what I see when I create a new Collection child (ace-fields.png). I understand why the <> button results in a popup, instead of simply switching into what I see in my screenshot. What I don't quite see is how, when using TW, I'm supposed to switch to Ace without using the <> button, which would then be inferior, and entirely redundant.

                      With 'disableEnableCheckbox' enabled I imagined I might get Ace if I unticked to disable TW. If that was the case, and it isn't, it would seem that when creating a new child of a Collection, perhaps TW simply wasn't activating, leaving room for Ace. Clearly I have no idea what I'm talking about. Totes confused.

                      I've also attached what I see, correctly, when I edit an existing resource, or create a new one that isn't a child of a collection (TW-fields.png). I has occurred to me that perhaps I'm barking up the wrong tree, aiming for a scenario that isn't realistic, even though it seems like the holy grail. I'd like to have TW-fields.png, with a tickbox or button to switch seamlessly into ace-fields.png, but where in ace-fields.png all the text area fields are Aced, including 'Description', I'd like 'Description' to remain a plain text field because I'm using it for, well, the page description which needs to remain void of HTML.

                      Apologies to readers (Don?) - I've made a multitude of alterations to this post since attaching the first attachment. I notice it has been downloaded once already, so there's a possibility I've edited quite a bit of the text above since. [ed. note: davidsmith last edited this post 7 years, 10 months ago.]