I'm having issues with the alignment of images in articles using CKEditor.
I'm inserting the image fine, and in the 'edit' window the alignment and text wrapping works fine, but in the 'view' pane (or the actual live site page) the text doesn't wrap properly (see screenshot).
The install is fairly new. I have views etc installed if that makes a difference, but all settings are default.
Apologies if I'm doing something stupid or overlooking something, I seem to have got myself into a confused mess and really do need some 'pointing in the right direction.

thanks in advance,
M.

CommentFileSizeAuthor
view mode.jpg64.39 KBMarshcast
edit mode.jpg75.01 KBMarshcast

Comments

mkesicki’s picture

Component: Code » Miscellaneous
Priority: Major » Normal

I think this is not editor/module bug or something. When you save image with align set , those settings are saved (look at source of your html page -> there is float style set for image). I think that your problem is related with style used by editor and page. You should try configure editor to use the same style as on page view. Please go to Configuration -> CKEditor -> Choose profile you use -> Css section. Try to use theme css setting in Editor CSS select field.

Marshcast’s picture

Thank you for your reply, michal.
That made a lot of sense to me, but still have the same problem.
I tried also to switch the 'predefined styles', but am seeing exactly the same behaviour.
The HTML doesn't appear to save any of the settings:
Only local images are allowed.
- no 'align' at all.

is there another setting that saves the settings?
I have no custom code/css.

Marshcast’s picture

PS: just to re-state how much I appreciated your quick and efficient reply ;)

mkesicki’s picture

Category: bug » support

Which input filter do you use when creating article ? Maybe drupal strip some HTML code when saving . Please try use Full HTML input filter and check what happens.

lnovell30’s picture

I am having the same issues; It is so frustrating... Each wysiwig editor that I use has a problem; either it doesn't support media browser, which means no non-techie will want to remember the url for an image, or, in the case of CKE editor, I can't get basic image styles to even save!!
I've spent over an hour just trying to line the images up, to no avail. Looks great in editor, but get's stripped after being saved!

mkesicki’s picture

@lnovell30 maybe you use text format (input format) that strip some of your html code ? Please compare html source code which you have in CKEditor during adding/editing article and code that you have after saving it. Try use full html text format.

Marshcast’s picture

@Inovelle30
Think yrself lucky - I done 4 DAYS of it!!!!
It seems a little confusing, but it gets better once you start seeing what's going on, and I think there are good reasons why it's the way it is.
Saying that I have a long way to go :/
Here's some bits that may help make sense of it (it's the bits I learned in my days of anxiety ;)

When your editing an article there's a dropdown underneath - you can choose HTML or FULL HTML. it's worth trying the FULL HTML one to see if the function works on yr machine. ( i think the ADVANCED HTML has filters that strip the bits you want out of yr page). If the FULL HTML works, you know it's to do with yr filtering.

Hopefully it works in FULL HTML.
assuming it does....

Check the filters in the ADVANCED HTML text format. (yes, it's called a text format- bit confusing when it's actually an HTML format, but there ya go - ours is not to reason why... ;) I get there by going configuration>text formats and configure the FILTERED one (or - as I did (so I still had a secure 'filered' one) create a new one, copy it from the filtered one (i called it 'filtered IMG' so I knew it allowed images (they're not so secure)).
Add Only local images are allowed. to the list of allowed tags, then use that type in the drop down under this article.
Does this change your result?
it may not be perfect yet, but see how that goes and giz a shout.

Good luck!

Marshcast’s picture

@michal_cksource...

ok - am getting it a bit now, but the 'align' argument gets stripped if I have the 'limit tags' switched on in the text type (filtered html) - I do have Only local images are allowed. in there, but it stilll strips the argument for align. Do you know how I can get it to save the arguments? otherwise I cant filter the tags, and that sort of defeats the whole point.
I do realise this is probably a tax on your time, and apologise if i'm missing something I should have picked up, but I just can't see it. -- wood for the trees??

thanks for help so far,

M. :D

mkesicki’s picture

@Marshcast
try config your text/input filter in yourDomain/admin/settings/filters. Here you can set your drupal config for filters.

Marshcast’s picture

sorry - got me there, am D7... none of those menu's exist. Think this is a main prob with d7 & documentation, the menu structure seems to be totally different to d6 (this is my first drupal 'experience'!). Having said that I'm editing the filters in the 'text formats' config box (see attached). this where you mean?

I've got an 'Only local images are allowed.' filter in the apropriate 'text type' text filters, but it's dropping the arguments inside the Only local images are allowed. tag. Interestingly it doesn't drop 'alt' but does drop 'align' when publishing.

It Does, however, keep the (align) argument in the 'edit' pane - just doesn't publish it. I've tried adding 'align' to the list of tags (in a random fit of 'try it and see if it works' ((and along with lots of other random 'tests')) but to no avail.

Do you know why it could be dropping just the align arg?

mkesicki’s picture

@Marshcast pls try use full html text/input format . This should be in select below CKEditor. Than check if your alignments problems are solved. Than try to do your own/modified input filter, css and so on. :)

Marshcast’s picture

I started there, but am dropping CCKeditor now (or at least for images) and going for views with an uploaded image per article.
Sorry, I can't jusify the time spent trying to do simple things. I need to be able to just 'plug in' to the editor a bit more atm, I have too much to do re: structure to mess with images.

Sorry for using your time, and I hope this thread will help others a little.

may be back later when I'm on track with structure & content.

Thank you,

M.
:)

mkesicki’s picture

Status: Active » Closed (won't fix)
alexkb’s picture

Just in case anyone else comes across this thread - make sure you refer to the ckeditor README.txt, and look at the section "HTML Filters and Inline Styling". This basically explains why the inline styles and attributs get stripped out, and a solution.