We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 53612
    • 4 Posts
    I've searched the past days to find a solution to prevent tinymcewrapper cleanup for the symbol "&".
    My problem is that I want to implement a chunk with a parameter (eg. [[chunk? ¶m=`test`]]) but tinymcewrapper cleans the "&" symbol to & and so my chunk won't work.
    In my search I found some options for tinymce ('invalid_elements', 'custom_elements' or 'entities') but neither of them seemed to work after I wrote them to the system settings of tinymcewrapper.

    Is there a possible solution to prevent the code cleanup for the symbol "&"?
      • 42562
      • 1,145 Posts
      Entity encoding: A tiny plugin to preserve ampersand in TinyMCE.
      tinymce.init({
        selector: "#example",
        //protectAmpersand: false,
        setup: function(editor){ //place this part in your commonCode - avoid duplicates
          editor.on('SaveContent', function(ed) {
            if(editor.getParam("protectAmpersand", true)){ //allow editors to turn this off protectAmpersand: false,
              ed.content = ed.content.replace(/& amp;/g, '&'); //I preserved ampersand by spacing - please amend
            }
          });
        }
      });
      [ed. note: donshakespeare last edited this post 6 years, 8 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.
        • 24374
        • 322 Posts
        OK, so I know there was discussion a while back on this thread about making TinceMceWrapper work with MIGX, and supposedly that was implemented, but I can't get it to work. I'm running MODX 2.5.7, MIGX 2.11.0 and TinyMceWrapper 2.3.2.

        TinyMceWrapper doesn't install any chunk called "TinymceWrapperMIGX". Should it? Even when I install a chunk with that name and enter what's recommended, or enter the TV chunk configs into it, still no luck. The MIGX richtext field is just blank, and the toggle checkbox is there, even though I have that turned off in the global settings. Also, click the Done button does nothing; the data doesn't get saved and the window doesn't close after clicking that button.
          • 42562
          • 1,145 Posts
            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.
            • 24374
            • 322 Posts
            Quote from: donshakespeare at Aug 06, 2017, 04:14 AM
            RE: rainbowtiger
            See https://forums.modx.com/thread/97694/support-comments-for-tinymcewrapper?page=42#dis-post-550647

            You need to create the chunk TinymceWrapperMIGX with this content
            https://github.com/donShakespeare/TinymceWrapper/blob/master/core/components/tinymcewrapper/elements/chunks/sample.tinymcewrappermigx.chunk.html
            OK, that gets it working, thanks. Now, how do I remove the Disable/Enable checkbox? It's not obeying the property set settings. [ed. note: rainbowtiger last edited this post 6 years, 8 months ago.]
              • 24374
              • 322 Posts
              I just discovered that I can no longer enter links with anchors to other pages. In TinyMCE 3 I used to be able to enter this:

              /[[~345]]#someanchor

              Now when I enter that, two things happen:

              1. The slash at the beginning gets stripped off. I'm using absolute URLs, and if I enter "/somepage.html", the slash does NOT get stripped off.

              2. The hash and anchor name get deleted, leaving just "[[~345]]". If I enter "/somepage.html#someanchor" the hash and anchor name DO NOT get stripped off.

              So, something is going on here where TinyMCE 4 is treating MODX-style internal links differently than regular URLs. Is there any fix for this? If not, this is a major problem.
                • 42562
                • 1,145 Posts
                RE: rainbowtiger

                OK, that gets it working, thanks. Now, how do I remove the Disable/Enable checkbox? It's not obeying the property set settings.
                Ask Bruno. there is an issue with MIGX modals (IMNSHO) usurping the classname that is specific to MODX (rich-text).
                Maybe TW 3.0 will circumvent the issue.

                So, something is going on here where TinyMCE 4 is treating MODX-style internal links differently than regular URLs. Is there any fix for this? If not, this is a major problem.
                Since this is a MODX specific issue, it would appear that it has nothing to do with TInyMCE version 4 in se, or with TinyMCE in toto.
                But unique to my plugin that handles MODX link tags.

                It would also appear, that it is a feature, albeit mad, which can be turned off.

                In your commonCode chunk, or where you like specifically, do:
                modxMagicHoverLinkSettings: {
                  stripMODXurl: false,
                }


                Note!
                If you get any strange behaviour with your final link, please check (in commonCode chunk)
                remove_script_host: false, //change to true etc etc
                document_base_url: MODx.config.site_url,


                To test on the fly in your browser dev tools console, do:
                tinymce.activeEditor.settings.modxMagicHoverLinkSettings = [];
                tinymce.activeEditor.settings.modxMagicHoverLinkSettings.stripMODXurl = false


                All these beautiful things having been said, TWrapper 3.0 does not strip the hashtags thingy smiley.

                Cheers [ed. note: donshakespeare last edited this post 6 years, 7 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.
                  • 24374
                  • 322 Posts
                  Quote from: donshakespeare at Aug 25, 2017, 07:48 PM
                  RE: rainbowtiger


                  In your commonCode chunk, or where you like specifically, do:
                  modxMagicHoverLinkSettings: {
                    stripMODXurl: false,
                  }



                  All these beautiful things having been said, TWrapper 3.0 does not strip the hashtags thingy smiley.

                  Cheers
                  Thanks, that did the trick!

                  So when is 3.0 coming out?
                    • 42562
                    • 1,145 Posts
                    It is coming out soon, it will be a complete awesome historical event.
                    Yuuger than both Augustweather and ModxGregor
                      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.
                      • 24374
                      • 322 Posts
                      Having a problem with importcss. This happened on one site several weeks ago, and I fixed it (after many hours of hair-pulling). Now, I've installed tinymcewrapper on a new site, and the problem is showing up here as well. I copied all of the settings directly from the site on which I fixed the problem, and none of the other sites I've put tinymcewrapper on (about 10 sites at this point) are having the problem. Of course, I can't remember what I did to fix the first site, and didn't write it down anywhere. :-(

                      I've got:
                      content_css : "/css/styles.user.css",

                      and that is loading properly because the text inside the editing window is styled properly.

                      I've got:
                      plugins: "autoresize,preview,paste,contextmenu,image,fullscreen,code,charmap,searchreplace,textpattern, importcss,table,anchor,nonbreaking,lists,media,hr,template",
                      importcss_groups: [
                      {title: 'Table styles', filter: /^(td|tr|th|table)\./}, // td.class and tr.class
                      {title: 'Block styles', filter: /^(div|p|h2|h3|h4|h5)\./}, // div.class and p.class
                      {title: 'Bullet styles', filter: /^(ul|ol|li)\./}, //
                      {title: 'Link styles', filter: /^(a)\./}, //
                      {title: 'Image styles', filter: /^(img|figure)\./}, //
                      {title: 'Inline styles'} // The rest
                      ],
                      importcss_append: true,


                      And none of the classes in the css file get added to the Formats menu. I even tried just putting ONE simple, valid class in there to see if there was maybe some style in the css file was causing the import to fail, and still that one class was not imported into the Formats menu.

                      Do you have any ideas? Have you seen this happen before?? It's driving me crazy today . . .

                      I've attached two images, one from the working site, and the other from the not-working site.

                      WORKING:


                      NOT WORKING:


                      (sorry, ignore the links below. attachments seem to be broken on the forum, and now I can't remove them.) [ed. note: rainbowtiger last edited this post 6 years, 7 months ago.]