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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

TinyMCE Insert Image


Go to End


3 Posts   5486 Views

Avatar
lx

Community Member, 83 Posts

16 April 2009 at 1:26am

When i insert an image by clicking on the image-icon in tinymce, i can give it a css-class ("Alignment / style").
So when i choose "On the left, with text wrapping around." it generates the following html-code:

<div class="image left" style="width: 600px;"><img src="assets/Photos/452344-001.jpg?r=43299" alt="" width="600" height="450" /></div>

I dont know, why its necessary to have a <div>-tag around the image-tag.

The problem with this div-Tag is, that it doesnt change when you resize the image by draging with the mouse.

<div class="image left" style="width: 600px;"><img src="assets/Photos/452344-001.jpg?r=43299" alt="" width="320" height="240" /></div>

If you compare this with the demo on http://tinymce.moxiecode.com/examples/full.php you see, that the normal tinymce does not
insert a <div>-tag around the image.

So, how can i a remove the generated div-tag ?

Avatar
silverseba

Community Member, 26 Posts

16 April 2009 at 2:41am

Edited: 16/04/2009 2:41am

The Problem was discussed here: http://www.silverstripe.org/general-questions/show/255143
Seems that you have to edit some javascript code...

Avatar
lx

Community Member, 83 Posts

16 April 2009 at 4:42am

thanks! that is what i was looking for.