Jump to:

23493 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » TinyMCE - howto image without surrounding div

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 6021 Views
  • Bright Eyes David
    Community Member
    26 Posts

    Re: TinyMCE - howto image without surrounding div Link to this post

    p is for paragraphs, and the images in my content do not relate directly to singular paragraphs but, rather, the section of the text in general. All other styling issues you cite can easily be handled with CSS.

    Thanks for mentioning the HTMLEditorConfig. I'll take a look and see if it can be tweaked accordingly.

  • Devlin
    Community Member
    215 Posts

    Re: TinyMCE - howto image without surrounding div Link to this post

    Well, I hope you've read the advice for the current state of the HTML5 working draft.
    The HTMLEditorConfig won't do you any good for this specific... habit for the image tag and I advise you to get this to the TinyMCE community. But they will tell you pretty much the same as I did. No offense.

  • Dr√∂mbolaget
    Community Member
    3 Posts

    Re: TinyMCE - howto image without surrounding div Link to this post

    > I don't get the problem why a image should not get wrapped in a paragraph...

    As David said, an image should be able to float beside multiple paragraphs. There is no better way to do that to my knowledge than to float the img and let the other h1, h2, p etc just be regular elements with no special style.

    > However, you can disable the automatic paragraph via HTMLEditorConfig but this is simply nonsense and imho bad style of coding.

    Assuming your way of writing articles is the only way is narrow minded. Many articles contain long images that will require floating beside many pargraphs and even headings.

    The current model where the image gets the style, and the parent div/p doesn't get it is useless imo and is a bad style of coding.

    On our site we added a class that can be set on the p/div (pFloatRight) which makes the paragraph (or div) float instead.

    The real problem is that TinyMCE automatically embedds the img in a p if there is no subtitle. When there is a subtitle and the div is added it works as me and David intended.

Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.