We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18654
    • 191 Posts
    Will CKEditor eventually have the option to add custom css classes like TinyMCE does?
      God does not save those who are only imaginary sinners. Be a sinner, and let your sins be strong, but let your trust in Christ be stronger, and rejoice in Christ who is the victor over sin, death, and the world.
      • 28215
      • 4,149 Posts
      This may be controversial, but we are looking at stripping the custom-swappable-rte solution, and doing an in-house RTE based off of ExtJS’s provided Ext.form.HtmlEditor RTE only.

      So, as per your question, probably not.
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 18654
        • 191 Posts
        Cool. Sounds like the in-house approach would provide the most control and flexibility. Plus, it seems like it would be easier to focus on having one stable editor than managing issues in a variety of RTE’s.
          God does not save those who are only imaginary sinners. Be a sinner, and let your sins be strong, but let your trust in Christ be stronger, and rejoice in Christ who is the victor over sin, death, and the world.
          • 28215
          • 4,149 Posts
          Quote from: mattcdavis1 at Feb 20, 2010, 03:56 AM

          Cool. Sounds like the in-house approach would provide the most control and flexibility. Plus, it seems like it would be easier to focus on having one stable editor than managing issues in a variety of RTE’s.
          Our thoughts exactly.
            shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
            • 18654
            • 191 Posts
            So - are custom css classes still out of the picture for CKEditor now that the Ext.js RTE is not being integrated into the core?
              God does not save those who are only imaginary sinners. Be a sinner, and let your sins be strong, but let your trust in Christ be stronger, and rejoice in Christ who is the victor over sin, death, and the world.
              • 28215
              • 4,149 Posts
              matt: ideally, yes, once i can find out how to do so - CKEditor is a bit different than Tiny in this.

              The current version we have allows these params:


              stylesCombo_stylesSet
              The "styles definition set" to load into the styles combo. The styles may be defined in the page containing the editor, or can be loaded on demand from an external file when opening the styles combo for the fist time. In the second case, if this setting contains only a name, the styles definition file will be loaded from the "styles" folder inside the stylescombo plugin folder. Otherwise, this setting has the "name:url" syntax, making it possible to set the URL from which loading the styles file.

              The file looks like this:

              CKEDITOR.addStylesSet('default',[{name:'Blue Title',element:'h3',styles:{color:'Blue'}},{name:'Red Title',element:'h3',styles:{color:'Red'}},{name:'Marker: Yellow',element:'span',styles:{'background-color':'Yellow'}},{name:'Marker: Green',element:'span',styles:{'background-color':'Lime'}},{name:'Big',element:'big'},{name:'Small',element:'small'},{name:'Typewriter',element:'tt'},{name:'Computer Code',element:'code'},{name:'Keyboard Phrase',element:'kbd'},{name:'Sample Text',element:'samp'},{name:'Variable',element:'var'},{name:'Deleted Text',element:'del'},{name:'Inserted Text',element:'ins'},{name:'Cited Work',element:'cite'},{name:'Inline Quotation',element:'q'},{name:'Language: RTL',element:'span',attributes:{dir:'rtl'}},{name:'Language: LTR',element:'span',attributes:{dir:'ltr'}},{name:'Image on Left',element:'img',attributes:{style:'padding: 5px; margin-right: 5px',border:'2',align:'left'}},{name:'Image on Right',element:'img',attributes:{style:'padding: 5px; margin-left: 5px',border:'2',align:'right'}}]);
              


              So I’m trying to figure out how to integrate that via a property. There are a few ideas, and I’d love feedback on them:

              1. Currently you could just set that property to an absolute URL: mystyles:http://mysite.com/assets/js/ckstyles/styles.js that points to a styles definition JS file. This already works like this with the plugin property.
              2. We could have a custom property of some sort that in some kind of formatting could define things, but that gets hard as these are pretty dynamic JS structures.

              I prefer 1, as it requires no more work. What do you think?
                shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                • 18654
                • 191 Posts
                Thanks for the response - I wish I were skilled enough to offer some helpful input. Hopefully someone smarter than me will be able to contribute.

                -matt
                  God does not save those who are only imaginary sinners. Be a sinner, and let your sins be strong, but let your trust in Christ be stronger, and rejoice in Christ who is the victor over sin, death, and the world.
                  • 5340
                  • 1,624 Posts
                  It seems that the "CSS Selectors for Editor" are not working for both TinyMce and CKeditor.
                  Can somebody confirm this?

                  Thank you
                    • 18654
                    • 191 Posts
                    I think there may be a way to setup TinyMCE so that you can insert custom classes. It’s been a while since I played around with TinyMCE, but I think I had custom classes working at one point. I switched over to CKEditor because of the only-saves-on-first-save bug in TinyMCE (which has now been fixed), so I haven’t played around with TinyMCE recently. Last time I tried to install it it killed my resource browser.

                    As far as CKEditor - no custom classes as far as a drop down lists BUT if you click on the "div" icon right next to the block quote icon the dialog box that comes up has a field where users can enter custom classes. So - even though a drop down list of classes would be nice, at least there is some way for end-users to enter classes (and ids) without having to get into the source code.

                    -matt
                      God does not save those who are only imaginary sinners. Be a sinner, and let your sins be strong, but let your trust in Christ be stronger, and rejoice in Christ who is the victor over sin, death, and the world.
                      • 5340
                      • 1,624 Posts
                      only-saves-on-first-save bug in TinyMCE

                      Has this been fix in MODx Revolution 2.0.0-rc-1 rev6614, because I think it still happens to my install.

                      Also it seems that custom styles for TinyMce are not working. I tried

                      "test, test1" and "test=test,test1=test1"

                      in the "CSS Selectors for Editor" field but without success. Does this field work like for Evo?



                      Thx