Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

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

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

TinyMCE - howto image without surrounding div

Go to End

11 Posts   8378 Views

Bright Eyes David

Community Member, 26 Posts

11 December 2010 at 1:14am

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.


Community Member, 344 Posts

11 December 2010 at 3:01am

Edited: 11/12/2010 3:17am

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.


Community Member, 3 Posts

2 February 2011 at 11:36pm

> 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.

Go to Top