I've been working on getting CKEditor to work really well with Media. CKEditor in 4.1 brought the Widget API which allows creating fully and partially immutable HTML objects. This provides an ideal solution for managing and previewing Media's tokens reliably. Some initial support for CKEditor's Widget system has already been added but it was broken for me. Taking inspiration from the Placeholder CKEditor plugin I managed to get the WYSIWYG preview images working well within CKEditor again. To do this I took a partly different approach.

Previously the attempt at integrating a Widget based plugin used a custom tag element: <mediawrapper>. This was causing me some issues and seems unnecessary. All converted Media tokens have the class "media-element". This is all we need to easily detect a HTML element that is handled by media. On top of this the <mediawrapper> will behave only as an inline element. This means CKEditor will allow the media element within areas the rendered output will not be semantically accepted in.

Sometimes the tokens cannot be converted for various reasons. This does not mean the token should be discarded, potentially loosing the user's data. But the token is not intended to be treated as bits of text that are easily broken. So if a token cannot be converted I still turn them into a uneditable widget that is easy to move around and if the user is sure they do not want it, it is easily removed with one press of the delete key (don't worry undo is still there ;) ).

As for the handling of detecting and converting tokens I am using CKEditor's API rather Media's JS library to do this. This allows handling each token individually and in an isolated way. The previous method had the upcast calling Drupal.media.filter.replaceTokenWithPlaceholder() on upcast. This caused replaceTokenWithPlaceholder() to parse the entire and parts of the content multiple times which I recall caused me various quirks (sorry I did not keep a note at that point of the issues I discovered with the approach). I am still calling replaceTokenWithPlaceholder() in my basic proof of concept approach but only the token ever gets passed in rather than all the content. I think replaceTokenWithPlaceholder() should be broken into two parts. One for finding tokens and one specifically for converting the token but that is a different topic.

I have attached a patch that implements this basic CKEditor Widget powered support. I know a lot of people are currently having issues with CKEditor and Media so I thought this might be useful to release. It is the most minimal of changes. It does make a change to Drupal.media.filter() so that the function does not crash Javascript when it is unable to find a token's HTML within tagmap. This is the least complex of my patches. I am using CKEditor's initAfter() method to do the equivalent of upcasting the tokens. I had to move prepareDataForWysiwygMode() and prepareDataForSourceMode() around so that they could be access within initAfter().

As I mentioned this patch is basic and you cannot resize images or apply element based style's to them but as of CKEditor 4.4 it is possible to define widget styles like so:

CKEDITOR.stylesSet.add( 'drupal', [
  {
    name: 'Align media element left',
    type: 'widget',
    widget: 'mediabox',
    attributes: { 'class': 'align-left' }
  },
] );

A more developed solution

As Widget allows maintaining complex HTML as one unit I wanted to show the actual full rendering of a token within the editor rather than a fixed image preview. So I have developed this much further and I now have:

  • Images resizing. This can easily be allowed for non-image widget's as well but I have deliberately limited this for now to keep things simple.
  • Ability to define alignment classes or use float's on media elements. I am using the same class name configuration as image2:
    config.image2_alignClasses = ['align-left', 'align-center', 'align-right'];
  • Apply CKEditor styles. The method of how I have done this is a bit of a hack but it works well. Note you cannot use the styles dropdown in the editor toolbar except for the styles defined as widget styles. Instead use the widget's dialogue by double clicking on the media element widget.

I ended up handling most of the token/HTML conversion within the plugin as there were too many issues and assumptions from the ones in Drupal.media.filter. The method's there are built on the assumption that the preview is an <img>. I have still tried to make use of methods there that I can (create_element, outerHTML) but I did have to do a bit of a hack to prevent create_element from destroying the content when it came across link's within the content.

This all works on full renderings of the file entity within CKEditor. Ideally Media would allow a WYSIWYG editor plugin to state they can handle a full render (instead of a preview image) but this can be done (inefficiently) by overriding the token rendering in: hook_media_wysiwyg_token_to_markup_alter() and hook_media_wysiwyg_format_form_prepare_alter(). I have made a module that does this for my projects. If anyone is interested I can post the module? Anyway with the actual HTML renderings being used within the editor, CKEditor can properly manage the content and prevent the user making mistakes (e.g. no <div> within <p> tag). Using the custom <mediawrapper> tag would prevent this.

I've pushed my work to github for the time being as this is making some quite fundamental changes and I would like this in better shape before submitting a patch but before doing that I wanted the community and Media developer's feedback as I am going in some different routes here and would prefer a "no that's not gonna work" now than after the work. See the bottom of this post for link's and branch information.

Some notes

I have only tested this with the CKEditor Module and not the WYSIWYG module. There is a good chance it will just work there but if it does not then I don't think much work is needed to make that happen.

Also my development has been with CKEditor 4.5 (which supports nested widgets).

I've also not test the image2 plugin with this yet. They may conflict but they may not because of how the media elements are initialised. If it does I think we could override the widget 2 definition with another plugin to make it ignore <img> tags with the class 'media-element' (or any other reasoning).
UPDATE: I've tested with image2 now and it seems to work fine. A normal image added via image2 (or already existing) will be managed by image2 and Media's files are handled by the mediabox widget. This means you cannot use image2's capture feature with a Media powered image but I think that's fine as the File entity's fields can handle this. Plus one can always place the image in a <figure> element themselves.

Also note that my testing has shown this has fixed various issues with Media and CKeditor including:

I have not tested the legacy wrapper support as I do not have any content that used the old &lt;!--MEDIA-WRAPPER-START-. I may have broken the old support code so if someone could test and help with it that would be great. I do not intend to support not using the Widget system. I see nothing that can be gained by not using the Widget plugin and with CKEditor 4.5 widgets can be nested (which was my only show stopper in the past).

Token's that are intended to turn into raw URLs will not work within a link. This could be fixed by detecting where the token is but I think module's like Linkit and Portable paths are better suited to handling that problem.

Todos and Further development

Styles combo (css classes)

As I mentioned setting style's on the media element widget is done in a bit of a hackish way and does not use the styles dropdown. CKEditor 4.4 introduced the ability to define custom style handlers:
CKEDITOR.style.customHandlers.YOUR_HANDLER
I've not properly looked into this yet but it seems we could potentially define one specifically suited to handling media elements. Why do this and not simply define a "widget" style type? Because each file type and display should be handled differently. If you define a style for the mediabox widget (mediabox is the actual widget name of the media element), then it applies to all media elements. This means classes intended solely for images can apply to file links and vice versa. My current hack looks at the rendered media element and gathers all element styles that are applicable to that style. This is not really a bad thing but it does have limitations (the styles combo dropdown allows modular toggling of styles).

Inline editing of fields

One of the points of CKEditor's Widget system is to allow controlled editing of certain parts of the widget. We could allow the user to override fields right within the editor window. E.g. Adjust the caption of an image easily. Doing this for single item fields would be quite straight forward but a limitation in the widget API would make this more difficult for multi-value fields but I believe is still doable (I've created dynamic multiple row widgets in the past).

Make the media dialogue work again on existing mediabox widgets

Selecting a widget within the editor and clicking the Media button in the toolbar does not trigger the edit dialogue but instead brings up the media browser for inserting a new file.

Decide on code sharing with other WYSIWYG editors

It would certainly be possible to share more code again as currently most of the token/HTML conversion is handled within this plugin. However at the same time I think it is a good idea to use more of CKEditor's API rather than jQuery depending on where things are happening. Mixing jQuery within things that go into the editor window does not seem like a good idea to me. At the end of the day tighter more specific integration with CKEditor will lead to the best user experience.

Allow themes to declare protected classes

As usual, a theme's preprocess can add extra css classes to the file entity template's classes_array variable. However, during WYSIWYG editing, media.filter.create_element() will strip these extra classes which can affect the intended presentation. There should be away to allow these classes in WYSIWYG but not allow user's to set them.

Show me the code (links and branches)

All code is currently available at:
https://github.com/magicmyth/drupal-media-ckeditor

Branch: ckeditor-widget-basic
This is the the initial just get it working in CKEditor branch. The attached patch is a cleaned up version of this patch.

Branch: ckeditor-widget-basic--adjustable
This is my initial work to add more features. It's here now just so others can see how I have gone about the development (easier to see what I was thinking :D).

Branch: ckeditor-widget-full-rework
This is my current development branch. I've cleaned up the code developed in the other branches. It also no longer makes any changes outside the CKEditor WYSIWYG plugin.

I hope someone finds this helpful?

Thanks all.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

magicmyth’s picture

Attaching my basic just get it working patch. If my proposal seems good to the devs I think it might be a good idea to get this simpler patch committed first as it lays the foundation of the other work and at least makes inserting file entities at least work again. However if this were to be committed then perhaps the part of the patch that touches media_wysiwyg.filter.js should be removed and committed as a separate issue?

magicmyth’s picture

Status: Active » Needs review
magicmyth’s picture

Issue summary: View changes
magicmyth’s picture

Got bored and did a quick test with image2 installed. It seems to work without conflict now. Few that saves me some work :) (touch wood).

magicmyth’s picture

Issue summary: View changes

Edited to mention image2 compatibility.

jwilson3’s picture

This is really interesting. I read through most of the issue summary but when I got to the part about not being able to use the Caption feature of Image2, I was disappointed.

I've been working on a ckeditor_image2 module (https://www.drupal.org/sandbox/jwilson3/2454995), and would really like to see the ability to import an image into a page with Media module, and have the ability to edit the Caption in the wysiwyg editor.

From your summary, it sounded like it is technically possible to have a widget inside a widget (aka a media image widget inside the image2 figure/figcaption widget). What are the technical challenges to overcome to get this to work?

magicmyth’s picture

@jwilson3 Because the image and figure are one single widget it would not be possible to make this work with the image2 widget (at least not without specific modifications to image2). However that does not mean we cannot achieve the same result. The simplest solution would be an additional CKEditor widget that simply generated the figure markup and allowed an <img> and/or mediabox widget to be placed in it.

Keep in mind that the media module already allows you to add fields and edit them during insertion. All you need to do is setup a suitable display that displays your caption field. As I mentioned, inline editing of the (simpler) fields should be doable. So even though this cannot work with image2 and its caption feature, we can still achieve the same result.

Devin Carlson’s picture

Project: D7 Media » Media CKEditor
Version: 7.x-2.x-dev » 7.x-1.x-dev
Category: Bug report » Task

We are deprecating the ckeditor integration and moving it to a separate module.

magicmyth’s picture

That makes sense to me. Carrying special integration for every editor would build into a lot of noisy code. Is it this the project?
https://www.drupal.org/project/ckeditor_media
Doh! Too early in the morning. Did not realised this issue had already been relocated to the new independent module. If the developers are interested I could port the code over to the new module?

magicmyth’s picture

Here is a patch against Media CKEditor. This is not the simple get it working patch from my first patch but a straight copy and paste of the javascript files from my ckeditor-widget-full-rework branch. This means it includes image resizing, image alignment (inline and CSS class), supports CSS classes defined in styles, does not conflict with image2 and various fixes.

Note to get best results you want to prevent Media rendering a preview image of the File Entities within the WYSIWYG and instead render the full entity as it should be shown on the front end.

bneil’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
magicmyth’s picture

Note as this new module is depending on the Widget plugin then a bunch of code can be removed. It could be done in one patch (this issue) or handled in another issue and then the patches here updated against the changes?

@bneil I see in #2542276: Integration with Media 1.x your proposed changes for the Media v1 branch. You are integrating a lot of functionality that was provided by Media WYSIWYG which makes a lot of sense for Media v1 but are you thinking similar should be done in the v2 branch? I don't know the direction of Media WYSIWYG and if it intends on housing common libraries all editors could share or if Media CKEditor intends to fully supplant? (Any input from the other devs (@Dave Reid, @Devin Carlson etc) would be much appreciated ) If the former then Media CKEditor V2 should make use of as much of it as possible (though Media WYSIWYG should be altered to make less assumptions) and would have less impact on my work here. If the later I would be more than happy to help out on the development and give my input but naturally that impacts at least in part on my patches so I would hold of on some more development for the time.

@bneil Just a suggestion, in your patch for issue #2542276, you might want to consider using the initAfter() method I am using to setup the media elements (see my first patch as it has less changes) as it seems much more reliable. I at least for a time, don't plan on doing Media V1 testing (though I do have some sites making use of it so probably will at some point) but I think my experiments are still applicable and would need minimal changes to work with your patch. (off topic but I did not know of CKEditor's Fake Objects which I learned of from your patch so thanks for that :) )

BTW If anyone was wondering my patch in comment #10 applies fine to the current 7.x-2.x branch.

BrightBold’s picture

Thanks for this! I spent two days trying to fix the Uncaught RangeError: Maximum call stack size exceeded error and this patch fixed it and got the editor working. It sounds like the patch will allow for a lot of other great features as well, but for now I'm just delighted about the bugfix.

Devin Carlson’s picture

Status: Needs review » Needs work
magicmyth’s picture

@Devin Carlson I'll attempt a reroll against HEAD in a couple of weeks (I'm away from all things computerised for a week :) ). Its good to see the old mediawrapper being removed when the Widget API is not present but does this not make more sense in the 7.x-1.x branch? The project page states that the Widget plugin is a requirement for 7.x-2.x. So should we not remove all the non-widget support and pre CKEditor 4.3 support? If so that would provide a good point for my work to be based on.

ShaunDychko’s picture

#10 definitely helps a lot, and it applies cleanly to 7.x-2.0-alpha1. It makes sure that an inserted picture stays with a "widget" box in CKEditor when editing content that was previously saved. Without #10 the widget box is gone after editing, and this is a problem when displaying files with the Picture module. The patch provides a "mediabox" dialog for CKEditor which I can't make work. Probably this has to do with the Picture module since I tracked things down as far as line 119 of mediabox.js, which says

      // Currently only supporting these options for images.
      if (widget.element.getName() != 'img') {

, but updating that conditional to allow for picture elements left things broken. An unfortunate workaround is to disable the dialog in the theme's ckeditor.config.js:

CKEDITOR.on( 'dialogDefinition', function( ev ) {
  var dialogName = ev.data.name;
  var dialogDefinition = ev.data.definition;

  if (dialogName == 'mediabox') {
    var contents = dialogDefinition.getContents( 'info' );
    contents.remove( 'height' );
    contents.remove( 'width' );
    contents.remove( 'align' );
    contents.remove( 'elementStyle' );
    contents.elements = [
      {
        type: 'html',
        html: '<p>To edit this image please insert it again and then delete the old one.</p>'
      }
    ];
    dialogDefinition.onShow  = function(){};
  }
});
ShaunDychko’s picture

In #2620648: Extra p tags inserted when editing content with embedded images. I explain that a line can be added to make sure the widget is inline with the "picture" element, preventing extra "p" from getting inserted.

ShaunDychko’s picture

Added one line to patch in #10 to make inserted picture element wrapped in an inline widget element. Solves #2620648: Extra p tags inserted when editing content with embedded images.. Applies against 7.x-2.0-alpha1.

marcoka’s picture

applied 2513454-17-improving-ckeditor-integration.patch to version = "7.x-2.0-alpha1"
now i get "Uncaught TypeError: Cannot read property 'align' of undefined" in the console log, body text is not loading.

brockfanning’s picture

Because I need media and media_ckeditor for a current project, I've been posting a lot of small patches to this issue queue, many of which I suspect are improvements that may have been contained in this rewrite. I think it would be good if we could turn this into a "meta-issue" and have the code changes actually be in separate issues. Otherwise I think this ticket will be stuck always needing a re-roll.

To start, if anyone could list the improvements/fixes this patch provides, I can at least try and point to separate patches that might duplicate the feature.

nikathone’s picture

A new patch which apply against 7.x-2.0-alpha2.

joseph.olstad’s picture

Status: Needs work » Fixed

It is committed to 7.x-2.x dev
please test the latest 7.x-2.x dev to confirm

brockfanning’s picture

Can anyone summarize what features and/or fixes this patch provides?

joseph.olstad’s picture

@brockfanning this commit is not in a release (only in dev). as for a summary, from what the description says this patch makes use of CKEditor's API rather Media's JS library when capable. I'd consider this commit a high risk commit, this is why I have no immediate plans to push a release with this.

Right now I'm going to be heavily putting 7.x-2.0-alpha2 release through its paces which doesn't have this commit. going to run some more tests on 7.x-2.x dev before making anything out of it.

ptsimard’s picture

I tested the latest dev last night for a few hours and I'm running into issues related to this 'mediabox'.

For example, if I copy paste a media token from one node to a new one into the "Source". And flip back to wysiwyg mode I get an error on ".getOuterHtml();" because wrapElement returns null on this code:

   widgetWrapper = editor.widgets.wrapElement(
                    new CKEDITOR.dom.element.createFromHtml(
                      '<span class="media-element media-element-token">' + media + '</span>',
                      editor.document
                    ),
                    'mediabox').getOuterHtml();

I'm not sure what mediabox is supposed to be but it's broken.

brockfanning’s picture

@ptsimard: Does that procedure work without this patch? Say, if you go back to commit ffa8be3cd1c38efa8932dc02b333df3a6d877e19
I have a feeling that it may still give you an error (though possibly a different one).

@joseph.olstad: I think it's going to be tough to test this without knowing what exactly it's supposed to do. From the code of the patch it seems to be largely new functionality, but with a few scattered changes here and there. Since the issue description was written, media_ckeditor has split out from Media and has implemented Ckeditor's Widget API. So I feel like this is in need of an updated explanation, preferable detailing the problem it is solving and the changes that it makes.

joseph.olstad’s picture

Based on @ptsimard tests We should probably rollback the commit. Maybe a new branch or project for the major changes if at all.
Thx

joseph.olstad’s picture

Status: Fixed » Needs work

nikathone’s picture

The two issues I had which this patch was solving are:

  • Ability to resize the inserted image
  • Ability to float left or right the embedded image

I am sure the floating left and right functionality can be added by implementing hook_media_wysiwyg_format_form_prepare_alter() then adding some template preprocess. The thing I like about the approach of the patch it's using almost the same idea as if you were embedding the image through wysiwyg and it much user friendly.

@ptsimard can you tell us the version of ckeditor library, media module and ckeditor module you are using? May be it might help to reproduce the error.

ptsimard’s picture

All this patch did for me was failing at a different step in the process. Before It was failing at something liek TagName function or somesuch. Sorry I'm not in front of this code right now and can't be more specific.

Regardless of this patch or not I was getting errors before when copying a token in source mode (or renaming a file id in a media token, to test) switching back out of source mode and the whole wysiwyg would be blank.

@nikathorne: I'm using the latest ckeditor, I think 4.5.11 via the CDN and associated widget/line utils plugins. Also the latest Media beta. AlsoI'm testing with files, not just images. Are you using the image2 plugin or something when you say "Ability to resize the inserted image"?"

@joseph: Please don't be too quick on the commit and or revert buttons. We need to discuss the issues before making big sweeping changes.

Maybe my setup is wrong but in general the whole media + media_ckeditor setup is broken for me. So very very brittle and unreliable.

joseph.olstad’s picture

@nikathone : without using this patch I seem to vaguely recall successfully testing float right or left the embedded image in a vanilla install the other day on simplytest.me using the latest releases of media , media_ckeditor , ckeditor , multiforms and file_entity , d7 core 7.51 . I did not need this patch to do that from my memory, however I would like to run some more tests to figure out exact configuration I used.

@ptsimard

here is some documentation for setting this up, may help out

Setting up WYSIWYG and CKEditor to include Media Browser / Embed Media button

ptsimard’s picture

@joseph ... that documentation has been updated in 2014... and reference ckeditor 3.x so not very helpful. Setting this properly is a lot more involved that what that guides mentions. It also mentions installing the WYSIWYG module.. Which I'm not using. I'm using the standalone ckeditor module. This guide predates the media and media_ckeditor split.

The last comment refers to unzipping everything.. are you saying that you can't use it with default way of using CDN from ckeditor module?

Sorry if I sound harsh. I'm just very salty about this whole broken D7 media experience.

joseph.olstad’s picture

@ptsimard, see this comment 5 months ago

https://www.drupal.org/node/1882314#comment-11287061

kingfisher64 commented 5 months ago

Download and install https://www.drupal.org/project/media_ckeditor

1) configuration > content authoring > text formats > enable filter (convert media tags to markup) > save.
2) configuration > content authoring > ckeditor > full or advanced > edit > editor appearance, drag turquoise button which is what we have just enabled in the filter into toolbar.

I think they have simply removed it from x2 branch of media.

ptsimard’s picture

@joseph:

2) configuration > content authoring > ckeditor > full or advanced > edit > editor appearance, drag turquoise button which is what we have just enabled in the filter into toolbar.

So I did not see this step... I have a diferent Add Media button (not turquoise). So I went there and added the MediaEmbed turquoise button to the toolbar. But it never shows up on any edit page. I cleared cache a zillion time. Doesn't show up.

ptsimard’s picture

joseph.olstad’s picture

I'll update the documentation soon, I'm working on switching one if my clients sites wysiwyg from TinyMCE to ckeditor and we're using media and we'll need media_ckeditor. I'm not sure how far I'll get friday though.

As for that other issue, I just queued the patch for #2567275: Media plugin is not able to detect widget plugin registration properly for testing

joseph.olstad’s picture

@ptsimard

actually I did notice what you described on a wetkit distro client, their site is heavily customized now, but still has TinyMCE and wetkit_wysiwyg , I tried uninstalling wetkit_wysiwyg and I could not get the widget to go in, I'm thinking there's some other problem.

I'll run some more tests on http://simplytest.me but on a vanilla D7 , the other tests I ran seemed to work ok the other day but I don't recall adding the media widget to fields. Not sure if this is related to this issue or not.

Followup soon.

joseph.olstad’s picture

Patch #21 needs a reroll, hunk #3 is failing on latest dev 7.x-2.x .

patch -p1 < 2513454-21-improving-ckeditor-integration.patch 
patching file js/plugins/media/dialogs/mediabox.js
patching file js/plugins/media/library.js
patching file js/plugins/media/plugin.js
Hunk #2 succeeded at 406 with fuzz 2 (offset 8 lines).
Hunk #3 FAILED at 538.
Hunk #4 succeeded at 686 with fuzz 1 (offset 44 lines).
Hunk #5 succeeded at 747 with fuzz 2 (offset 41 lines).
1 out of 5 hunks FAILED -- saving rejects to file js/plugins/media/plugin.js.rej
joseph.olstad’s picture

Ok, I refactored / rerolled patch #21
This patch is to improve integration with the image 2 plugin and the contrib module ckeditor_image2

I haven't yet tested this patch but I am hoping to get it to work so that we can use the image2 plugin with media_ckeditor .

see patch:

joseph.olstad’s picture

Status: Needs work » Needs review
joseph.olstad’s picture

Reviewing patch #42 ,
Getting this javascript error:

TypeError: a.split is not a function

and image2 plugin shows up as 'array'

Needs work.

joseph.olstad’s picture

Status: Needs review » Needs work
joseph.olstad’s picture

Status: Needs work » Needs review
FileSize
33.94 KB

This patch might work.

joseph.olstad’s picture

using ckeditor latest release 4.6.2 , with this patch 46 for media_ckeditor , using a version of recipe 9, I get this error:

TypeError: a.split is not a function[Learn More]  ckeditor.js:248:103
	CKEDITOR.resourceManager.prototype.addExternal sites/all/libraries/ckeditor/ckeditor.js:248:103
	Drupal.ckeditorLoadPlugins sites/all/modules/ckeditor/includes/ckeditor.utils.js:219:9
	Drupal.ckeditorInit sites/all/modules/ckeditor/includes/ckeditor.utils.js:141:27
	Drupal.ckeditorOn sites/all/modules/ckeditor/includes/ckeditor.utils.js:182:7
	attachCKEditor/< sites/all/modules/ckeditor/includes/ckeditor.utils.js:292:9
	c</<.each misc/jquery.js:34:44
	c</b.prototype.each misc/jquery.js:27:386
	attachCKEditor sites/all/modules/ckeditor/includes/ckeditor.utils.js:285:5
	Drupal.behaviors.ckeditor.attach sites/all/modules/ckeditor/includes/ckeditor.utils.js:346:7

and the ckeditor fails to load.

checking the minimized code on ckeditor.js
return CKEDITOR.getUrl(this.getPath(a)+(d?d.file:this.fileName+".js"))}

so something is wrong with the patch.

Here's a screenshot from the config page, this gives an idea of what the problem manifests as (Array) for form-item-loadPlugins-image2:

/admin/config/content/ckeditor/edit/Advanced
debug

joseph.olstad’s picture

Status: Needs review » Needs work
joseph.olstad’s picture

if disable ckeditor_image2 module that the patch is supposed to integrate with, the 'Array' item becomes 'image2'

could be something wrong with the ckeditor_image2 module.

joseph.olstad’s picture

Status: Needs work » Postponed

Update:

I ended up using imce to provide image properties .

without any patch just using the media_ckeditor I was able to get image2 plugin to apply to the media browser file entity by clicking 'source' and then going back to 'wysiwyg' mode, however after saving and then new draft and editing the image the media browser could no longer find the file entity .

So I ended up disabling the image2 plugin and for that functionality left and right float of image I'm using the imce plugin with the default image plugin, media browser image properties is not enabled however there's a workaround I'm looking into for that.

so basically my client for now is going to be using imce and the image plugin to do things that currently aren't out of the box with media embed , and media embed for things that imce cannot do.

There's another ticket for media float right and left , so we should followup with that.

Postponning this issue in favour of:

#2842391: better support for float media left and float media right

joseph.olstad’s picture

Status: Postponed » Active
Parent issue: » #2919974: Media_WYSIWYG css is not loading in CKeditor iFrame
joseph.olstad’s picture

there's lots of good information in this issue to help with
#2919974: Media_WYSIWYG css is not loading in CKeditor iFrame

joseph.olstad’s picture

Status: Active » Closed (duplicate)

Helpful information in this issue, however prefer to continue work in :
#2919974: Media_WYSIWYG css is not loading in CKeditor iFrame
instead

jwilson3’s picture

Status: Closed (duplicate) » Active

@joseph.olstad whoops, you've closed this as a duplicate of itself!

I'm not sure if you meant to close as a duplicate of #2842391 or of #2919974 since you've mentioned both in your last couple comments.

joseph.olstad’s picture

Status: Active » Closed (duplicate)