• I am running WP 3.4.2, BBpress 2.1.2, and the latest Graphene theme.
    I am the admin on a poetry board. I would like to change the default behavior of Tiny MCE so that in the Visual editor a return is a line break and not a paragraph (which results in double spacing). I know that shift return gives a simple line break, but I would like to swap these two behaviors. Also many users of the board type up their work in MS word and then paste it into the editor. If they do this in the Visual editor, it becomes double spaced (not if they paste it in the HTML editor). Again, I would like to change this so that the text does not come out double spaced. I found some information in the codex:
    HERE but I am afraid
    that I don’t know enough to be able to use this information. Any help would be appreciated.

Viewing 15 replies - 1 through 15 (of 21 total)
  • They shouldn’t be pasting from Word, or any other word processor, at all without using the “Paste from Word” tool– middle of the second row of buttons in the visual editor. As you can see, it leads to formatting issues and you will eventually have more serious trouble than just double-spacing.

    The only way I know to change this is going to be global for the whole site, and it would be kind-of a tricky hack. Manipulating markup is not straightforward. I couldn’t tell you exactly what to do off the top of my head if I had to.

    Thread Starter Starejosel

    (@starejosel)

    Thanks,
    I tried using the Paste from Word and the Paste as Text tabs, and it didn’t help–still double spaced. Curiously, if I paste from textedit
    (default Mac text editor), there is no problem. Could the “Paste from Word” function be modified?

    I did find a suggestion somewhere to change the spacing but using

    .tinymce-content p {
        padding: 0;
        margin: 2px 0;
    }

    as a custom CSS in the graphene theme, but it didn’t work and actually broke the editor for topics posts and was a hassle to fix.

    Any suggestions would be most welcome!

    Thread Starter Starejosel

    (@starejosel)

    Can I do anything with the Advanced TinyMCE Config plugin? It looks promising, I just don’t know what I should try.

    Any help would be most appreciated!

    ..but it didn’t work and actually broke the editor for topics posts and was a hassle to fix.

    What you are trying to do will also break the editor for topics and posts. That is part of the problem with the fix you have envisioned.

    I told you to use the “Paste from Word” tool, not because it will fix your issue, necessarily, but because you will end up with other problems if you don’t. I’ve seen numerous cases of this. Word Processors are not meant to be code editors, and that is what you are using them for whether you know it or not. Word Processors insert all kinds of invisible control characters and other markup that should not be in a web page. It will break things. That is why you use “Paste from Word”.

    I really am trying to figure out a good way for you to do this. Are you poems posted in their own post type by any chance? Or on a particular page? I am trying to isolate them so that changes don’t break other things. What is your URL?

    Thread Starter Starejosel

    (@starejosel)

    Thank you! Here is the link: http://poetryroundup.us/whup and here is an example of what happens when people paste in their text: http://poetryroundup.us/whup/forums/poem/my-unravished-bride/. I have fixed most of the posts by hand (as admin–it is a pretty light traffic site).

    It would be perfect to just fix it for topic starts in the forum

    http://poetryroundup.us/whup/forums/forum/poems-and-prose-about-poems/dr-whup-ass-bitchass-poetry-roundup/

    which seems to turn a specific topic URL into just

    http://poetryroundup.us/whup/forums/poem/\[specific_topic]

    (presumably due to permalinks, but I don’t understand how WP makes up addresses).

    Thanks again for your interest!

    Martin

    Again, any help would be appreciated!

    Try:

    .bbp-parent-forum-5 .bbp-reply-content p {
        padding: 0;
        margin: 2px 0;
    }
    Thread Starter Starejosel

    (@starejosel)

    OK, I’ll try it, but before I do, can I ask a couple of questions–where did you find that it is parent-forum-5, and should it be .bbp-reply-content
    or .bbp-topics-content , and why?

    Thanks a lot!

    Martin

    p.s. I am already moving the content panel around on the page:

    #bbpress-forums div.bbp-topic-content, #bbpress-forums div.bbp-reply-content {
        margin-left: 100px;
        padding: 12px 0 12px 0;
    }

    Can I add the redefinition of p into that? How should I do that? What does the div. in front of bbp-topic-content do?

    Sorry about all these questions!
    Thanks a lot!

    Martin

    oops–I see that firebug answers a lot of my questions. I still have
    a problem; if I understand what this fix does, it doesn’t change the html that TinyMCE produces, just shrinks the space for < p > < /p >.
    But if someone pastes from, e.g., textedit, or uses the HTML panel rather than the Visual Editor, then the p’s are really between paragraphs and the lines are in just separated by < br >. I don’t
    want to mess up their formatting!

    Thanks again!

    OK, I’ll try it, but before I do, can I ask a couple of questions–where did you find that it is parent-forum-5, and should it be .bbp-reply-content
    or .bbp-topics-content , and why?

    It is in the generated page source. Open the page in a browser, view source, and look around.

    if I understand what this fix does, it doesn’t change the html that TinyMCE produces, just shrinks the space for < p > < /p >.

    Right.

    But if someone pastes from, e.g., textedit, or uses the HTML panel rather than the Visual Editor, then the p’s are really between paragraphs and the lines are in just separated by < br >. I don’t want to mess up their formatting!

    If your people are inputting inconsistent data, which is what is happening, you are going to be stuck with cleaning up the mess. You may h ave to style the <br/> tag to match the <p> tag, and who knows what else. That is just what you will have to accept if you are going to allow willie-nillie data.

    Thread Starter Starejosel

    (@starejosel)

    Poking around with firebug, it looks that what I need to restrict to is:
    (1) it should be in a class typic-type-topic
    (2) the div class bbp-reply-content should not contain any < br >’s.
    Can one add that into the conditions?

    Thanks a lot!

    Martin

    (2) the div class bbp-reply-content should not contain any < br >’s.

    You probably can’t prevent that… well, stripping those tags will open a whole new set of problems.

    Thread Starter Starejosel

    (@starejosel)

    That is just what you will have to accept if you are going to allow willie-nillie data.

    Have you ever tried to tell a bunch of poets what to do šŸ™‚ ?

    But I think that if I can add the two conditions above, I should be good.

    Thanks again!

    Martin

    Thread Starter Starejosel

    (@starejosel)

    You probably can’t prevent that… well, stripping those tags will open a whole new set of problems.

    I don’t want to strip them, I just want to restrict the redefintion of < p > to topics that do not contain < br >’s.

    I don’t want to strip them, I just want to restrict the redefintion of < p > to topics that do not contain < br >’s.

    Oh… that you cannot do. CSS is not capable of that kind of logic. I guess you could scan the post body before it prints to the screen and insert another class that you could target.

    Thread Starter Starejosel

    (@starejosel)

    OK, thanks–I think that I can figure out some sort of a compromise so that I shrink the paragraph space a bit to make the double space stuff look OK but not so much that the other stuff looks bad. I’ll fiddle.

    Thanks a lot. I guess though this doesn’t really solve the original problem of changing TinyMCE’s behavior.

    Should I mark this as resolved?

    Your original proposal seemed likely, to me, to be very complicated and prone to error, so I steered you away from it. If the CSS solution is acceptable then resolve the thread. Otherwise, leave it open. I don’t think I have to time to bite into that TinyMCE project though.

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Tiny MCE defaults’ is closed to new replies.