Jump to content

How can end-users add gaps/margins in TinyMCE?


onjegolders
 Share

Recommended Posts

Was just wondering if there was a simple way end-users can add gaps between their paragraphs from within the editor.

Am trying to loosen things up a bit and allow them to determine their own page sections from within the editor whereas normally I may have given them two or three separate text areas.

I'm trying to avoid adding margin-top to all the h tags/ margin-bottom to the p tags or equivalent.

Is there a way to do this within the editor? Or would I be better doing it myself through CSS?

Link to comment
Share on other sites

You can add custom configuration in TinyMCE. In the field settings under "Input" tab. You find the "TinyMCE Advanced Configuration Options". There you find some fields to overwrite settings.

You could try the options in TinyMCE for newlines behaviour. Though I'm not sure, since I don't use them, what would be what you need. http://www.tinymce.c...rce_br_newlines

In the setting field "Additional TinyMCE settings" you have a textarea to specify configs in a key:value format, each on a newline. So you could add these (no apostrophes needed or endline ","):

force_br_newlines : true
force_p_newlines : false
Link to comment
Share on other sites

As far as I know, TinyMCE doesn't have the option of automatically recognizing and converting <br><br> to <p>. I could be wrong, but I don't think it's even possible to identify the user's intention (breaks vs paragraphs) once the software makes an assumption about one or the other. TinyMCE does support making <br><br> where it would do a <p>, but then you end up with non-semantic junk markup as the entire block becomes a paragraph... and no real way to tell what should be a paragraph and what should be two breaks. I think it's best to educate the client that they are creating what ultimately becomes semantic markup, which is fundamentally different from a word document. To create content on the web, the client really needs to understand the very simple distinction here, and it's well worth the 2 minutes to explain it. :) I usually explain it to the client by demonstrating an address as being one of the few appropriate places to use breaks (shift-enter):

114 Holly Road<br />

Hopkins, MN<br />

USA

While you are there, it's also good to explain the difference between bold text and headlines. :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...