On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Quote from: donshakespeare at Sep 09, 2016, 11:13 PM
    RE: chrisandy

    Thanks for taking time and doing the always-rare habit of reading ... this thread.

    One more thing with TinyJSONGallery; let me know if it fires even though its TV is not attached to said resource.

    Cheers.

    No, it's not firing.
      Web site design in Nottingham UK by Chris Fickling http://www.chrisficklingdesign.co.uk
    • I've linked to my own style sheet in 'TinymceWrapperContent_Custom' but how do I use selectors from that stylesheet? In other words how can I add custom buttons to Tinymce?
        Web site design in Nottingham UK by Chris Fickling http://www.chrisficklingdesign.co.uk
      • RE: chrisandy

        You mentioned two things. Want to use own selector from stylesheet - for what purpose?

        Want to create custom button - for what purpose?

        If it is that you wish to have a list of classnames from your stylesheet to assign to links, images and so forth, you are looking for
        (might aready be included TinymceWrapperCommonCode)
        https://www.tinymce.com/docs/plugins/link/#link_class_list
        https://www.tinymce.com/docs/plugins/image/#image_class_list

        If you want to create a button, you need just a tiny few lines of yours
        https://www.tinymce.com/docs/demo/custom-toolbar-button/

        If you clarify I could be more precise.
          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.
        • For some reason I'm not getting notified of replies on this thread so apologies for the late reply.

          Really I just meant one thing. In the past I've made it easier for my clients to style certain parts of their text by creating CSS selectors in the following format...

          Numbered-List=numbered;Ticked-List=ticked

          I'm really just looking to replicate that. Calling it a button was a little misleading on my part.
            Web site design in Nottingham UK by Chris Fickling http://www.chrisficklingdesign.co.uk
          • Is this your question?
            http://stackoverflow.com/questions/25637248/tinymce-4-custom-classes-for-users-to-use

            This is your answer
            https://www.tinymce.com/docs/configure/content-formatting/#style_formats

            CODEPEN
            https://www.tinymce.com/docs/demo/format-custom/

            tinymce.init({
              ...,
              style_formats: [
                {title: 'Numbered-List', selector:'ol,ul', classes:'numbered'},
                {title: 'Ticked-List',  selector:'ol,ul', classes:'ticked'}
              ],
              ...
            });
            Now you have full control
              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.
            • That's exactly it thank you Don!

              With the addition of one line at the end...

              style_formats_merge: true,


              ...so the existing selectors get added to, rather than replaced.
                Web site design in Nottingham UK by Chris Fickling http://www.chrisficklingdesign.co.uk
              • Articles - unchecking the content area (according to the message below) in the Articles container results in not being able to create a new article - no error message just a dead button

                TinymceWrapper Raw Code Protection:
                Check this Articles Container > Template [Tab] > Content, before saving.
                Unchecking the box will not only disable but remove TinyMCE, thus protecting your cod
                e

                ...doesn't seem to cause a problem if left checked but thought I'd bring it up.
                  Web site design in Nottingham UK by Chris Fickling http://www.chrisficklingdesign.co.uk
                • @donshakespeare

                  On the back-end I'm using this
                  tinymce.DOM.loadCSS('/css/ace.css');
                  in my TinymceWrapperContent-custom Chunk to override the CSS located in twAceEditor.js.

                  As expected my custom stylesheet is correctly added to the Manager head tag, but its position is above the other Ace-related CSS so my changes are being overwritten.

                  Is there a way to force my stylesheet to come after all the other stuff?
                    Todd
                  • RE: chrisandy
                    Articles - unchecking the content area (according to the message below) in the Articles container results in not being able to create a new article - no error message just a dead button
                    Sorry, I could NOT replicate this issue - works here! [ed. note: donshakespeare last edited this post 3 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.
                    • RE: Eko

                      Other Ace-related CSS are overwriting additional non-twAceEditor.js related styles?

                      1. You may now safely ditch tinymce.DOM.loadCSS('/css/ace.css')
                      2. Determine the <style id=""> of the last Ace-inserted element - or simply use #mainCSSace
                      var taskCounter = 0;
                      var aceCheck = setInterval(function(){
                        // if(!ace == 'undefined'){
                        // if($("style#ace-chrome").length){  //look in the head of your dev tools, for the id of your theme
                        if($("style#mainCSSace").length){ //or target the id provided by twAceEditor.js
                          taskCounter++;
                        }
                        if(taskCounter = 1){
                          setTimeout(function(){
                            //alert("aceeeee"); //debug stuff
                            // $("style#mainCSSace").after('<link rel="stylesheet" href="/css/ace.css">');
                            // $("style#ace-chrome").after('<link rel="stylesheet" href="/css/ace.css">');
                            $("head").append('<link rel="stylesheet" href="/css/ace.css">');
                            clearInterval(aceCheck);
                          }, 1000); //wait a little bit
                        }
                      },2000); //check again for the existence of said style#id
                      
                      [ed. note: donshakespeare last edited this post 3 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.