We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6792
    • 11 Posts
    I’m using TinyMCE as my richtext editor and would like to have my own CSS formatting show in the editor when they are applied.

    It’s inserting the correct HTML tags (including my custom classes) just fine and dandy. They show up in the rendered pages -- but not in the editor.

    Is this possible? Thanks.



    David
    • Hi,
      I have not test it myself but i think, it’s what you want cool
      [Tutorial] Use CSS as MODx document (now compatible with IE)

      Thanks
      AHHP
        God loves me. 【ツ】


        MODX.ir (Persian Support)

        Boplo.ir/modx/ (Persian)
        • 10449
        • 956 Posts
        http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/content_css
        http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/theme_advanced_styles
          • 6792
          • 11 Posts
          ganeshXL is on to something with that first link.

          If I look at the source of the page in the lower-right frame of the MODx CMS Manager frameset (where you have the site’s tree listing on the left and the page editor on the right) I see the "tinyMCE.init" line in the head. That’s where I would need to add the

          content_css : "/mycontent.css"

          to call my own CSS file for the editor to use.

          But I can’t locate the html or php file that’s generating that page. (I’m sure I’m using the wrong terminology here -- CSS/HTML I know, PHP/JS not so much, yet!)

          Thanks for getting me this far; those links were very helpful. I’ll keep digging.


          David
            • 10449
            • 956 Posts
            In the MODx manager, go to:

            Resources -> Manage resources -> Plugins -> TinyMCE -> "general" tab: plugin-code

            you should be able to add or modify here whatever you like smiley
              • 36549
              • 572 Posts
              Hi,

              I’m also trying to add a link to my main stylesheet so the block elements (p, h1, h2 etc) can adopt the styles from my stylesheet within the tinyMCE dropdown.
              It’s just at the moment i have to set classes as the tinyMCE editor adds span class around content i want to style so instead of having...<span class="h2"></span> i want the code to be <h2></h2>.

              is this the code i need to add...exactly with the path to the stylesheet???:
              tinyMCE.init({
              ...
              content_css : "[(base_url)]assets/templates/template1/mystyles.css"
              });
              and where exactly do i add it if it is???

              I tried adding it in: Resources -> Manage resources -> Plugins -> TinyMCE -> "general" tab: plugin-code: but then the tinyMCE editor disappeared from the pages. I’ve taken a look at the frame source and can see the: tinyMCE.init information but i need to kow how i get to it.

              Any help appreciated.

              Thanks
                www.9thwave.co.uk
                   WEB | DESIGN | PRINT
                • 16905
                • 46 Posts
                Hey,

                I actually have the same question. Does anyone know where to input this code that ’janice171’ mentioned??

                "is this the code i need to add...exactly with the path to the stylesheet???:
                tinyMCE.init({
                ...
                content_css : "[(base_url)]assets/templates/template1/mystyles.css""


                I can not find where to place mine. I went to "Resources -> Manage resources -> Plugins -> TinyMCE -> "general" tab: plugin-code
                " But still had no luck.


                Thanks.
                • That gets set in the main site configuration; Tools -> Configuration -> Interface & Features, down near the bottom.
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org
                    • 16905
                    • 46 Posts
                    Sorry, I am a BIG TIME newbie to this.

                    I have loaded "/assets/templates/default/styles.css" where you have said load it, but still nothing is showing up in the textarea. It should be, shouldn’t it?

                    Any advice?