We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3749
    • 24,544 Posts
    I'm pretty sure I've done it successfully with the site's CSS file, but that was a long, long time ago and I could be wrong.
      Did I help you? Buy me a beer
      Get my Book: MODX:The Official Guide
      MODX info for everyone: http://bobsguides.com/modx.html
      My MODX Extras
      Bob's Guides is now hosted at A2 MODX Hosting
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      It can work, it all depends on how "specific" your site's CSS is. For example, if you have something like ".center .content h2" TinyMCE has no structure like that, so the h2 elements won't get the same styling.

      The CSS file to use is set in the System Settings, using the editor_css_path setting.

      What I usually have to do is use Firebug to view the actual Manager page and see the HTML that TinyMCE is using, then basically duplicate the relevant parts of the site CSS file with the addition of the TinyMCE classnames.

      TinyMCE loads an iframe with this as the main editing field:
      <body id="tinymce" class="mceContentBody" ...

      So the CSS would use something like ".mceContentBody h2" instead of ".center .content h2".

      Here's the HTML that TinyMCE inserts into a content field with just "hello" entered - everything in the <span>...</span> is TinyMCE:
      <div id="x-form-el-ta" class="x-form-element" style="padding-left:105px">
      <textarea id="ta" class="x-form-textarea x-form-field" name="ta" autocomplete="off" style="width: 791px; height: 396px; display: none;" aria-hidden="true"><p>Hello</p></textarea>
      <span id="ta_parent" class="mceEditor cirkuitSkin" role="application" aria-labelledby="ta_voice">
      <span id="ta_voice" class="mceVoiceLabel" style="display:none;">Rich Text Area</span>
      <table id="ta_tbl" class="mceLayout" cellspacing="0" cellpadding="0" role="presentation" style="width: 95%; height: 400px;">
      <tbody>
      <tr class="mceFirst" role="presentation">
      <tr>
      <td class="mceIframeContainer mceFirst mceLast">
      <iframe id="ta_ifr" frameborder="0" src="javascript:""" allowtransparency="true" title="Rich Text AreaPress ALT-F10 for toolbar. Press ALT-0 for help" style="width: 100%; height: 333px; display: block;">
      <!DOCTYPE >
      <html>
      <head xmlns="http://www.w3.org/1999/xhtml">
      <body id="tinymce" class="mceContentBody " contenteditable="true" onload="window.parent.tinyMCE.get('ta').onLoad.dispatch();" spellcheck="false" dir="ltr">
      <p>
      Hello
      <br data-mce-bogus="1">
      </p>
      </body>
      </html>
      </iframe>
      </td>
      </tr>
      <tr class="mceLast">
      </tbody>
      </table>
      </span>
      </div>
        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
        • 3749
        • 24,544 Posts
        @Susan: What the OP needs most (and what I can't remember) is how, exactly, to tell TinyMCE where your CSS file is. Do you know?
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          The CSS file to use is set in the System Settings, using the editor_css_path setting.
            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
            • 3749
            • 24,544 Posts
            Ah yes -- in the tinymce namespace.
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 45366
              • 45 Posts
              Thanks for the replies, little over my head but I'll show to my friend.