We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15200
    • 56 Posts
    Hi all

    Remark: When I edit a page in TinyMCE, I find myself cleaning up the code afterwards. This is not a good sign for when the site will go online and people who don’t want to have anything to do with HTML will edit pages on the site. I know this will sound stupid, but what to do? Is there a better editor? Is there a way to solve this?

    Question: Is there a user friendly way to let users access DIV’s I created? Like a div that will put the content in a box of 50% width etc? I and the site administrator will be able to do this in the code, but what about the other users of the site who want to be able to edit the site in a Word-like-environment?

    Thx in advance and greetings
    Kenny
    • The resource content shouldn’t contain more than basic <p> or header tags. If you need to have divs and other structural code, then you should re-think your basic template structure and use TVs instead of, or along with, the resource content field.
        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
        • 15200
        • 56 Posts
        Ok, I’ll have to think about that one.

        I have one more remark: when I select a first title in TinyMCE, it puts that in bold automatically... Is there a way to turn that off?

        Grtz
        • Do you mean h1? That’s the default browser styling for h1 tags. You can configure TinyMCE to use a specified .css file though. That’s in the Manager, Tools -> Configuration, the Interface and Features tab, scroll down to the Path to CSS File and enter the url to the css file you want to be used for the editor content area. For example;
          /assets/templates/<template-name>/css/default.css

          Or you can create a .css file specifically for the editor and link to that. Usually the CSS for a page will use classnames and IDs that aren’t part of the main content area, so the editor never gets the proper styling. For example, if you have a wrapper div, then a center content div where the [*content*] tags appear, any styling that depends on the outer divs, like #wrapper #center {background:#fff;}, won’t get used by the editor, since it doesn’t know about #wrapper or #center, it’s only working with the content in the [*content*] tags.

          http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/content_css
            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
            • 15200
            • 56 Posts
            First of all, that’s a great find smiley thanks for sharing wink

            Second, I just didn’t get it to work yet...
            I entered the path of my CSS file, but everything still looks the same in TinyMCE.
            I triple checked the path, even copied it and just replaced the "\" with "/", but no go.

            EDIT:
            Ok, I just found this: Now the CSS file is specified, my h1’s are not displayed bold anymore (on my website, in tinyMCE they still are).
            Did you mean this: when no css file is specified tinyMCE will give it’s default markup to the elements (by adding css properties to the elements in the html code)?
            And not: when a css file is specified tinyMCE will display the elements like they should appear on your website? (so if h1 has a green bottom-border, tinymce will display this)
            • That is correct. But if you have something like
              #center h1 {border-bottom: 1px solid green;}

              Tiny still won’t do that, because the part of the content that it’s working with doesn’t have the <div id="center"> tags. You may need to add a few directives specifically for TinyMCE using its own container classnames.
              body.mceContentBody h1 {border-bottom: 1px solid green;}
                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
                • 15200
                • 56 Posts
                Hmmmz, well, then it’s still not working... because I just defined my HTML elements without being dependent of their containers (except for the exceptions of course).

                TinyMCE still displays it like before...
                  • 20407
                  • 82 Posts
                  I know this is an old topic, but just to add my $0.02 in case this helps someone else: I also had trouble getting the editor to use my CSS, but in my case the path to the CSS file was wrong. I found the problem by activating the Net panel in Firebug while loading a Resource file to see if my CSS file was being loaded... sure enough it was a 404 and by looking at the actual request in Firebug I could see the error in the path.