Closed (fixed)
Project:
D7 Media
Version:
7.x-2.x-dev
Component:
WYSIWYG integration
Priority:
Minor
Category:
Feature request
Assigned:
Reporter:
Created:
2 Feb 2013 at 21:29 UTC
Updated:
23 Feb 2013 at 04:10 UTC
Jump to comment: Most recent file
Comments
Comment #1
DaneMacaulay commentedPatch
Comment #2
DaneMacaulay commentedComment #3
arthurf commentedI like this for the reduction of markup and the simplicity of it.
I'm not sure if this is now the place to start talking about removing the conditional on the markup if fields are present. I think it would make sense for all images inserted by media use the same markup.
Comment #4
DaneMacaulay commentedI'd be interested in exploring new options here. If we ditch the conditional we loose the ability to float left or right from within WYSIWYG.
I'm using the hook in a project to float the wrapper div left or right depending on the WYSIWYG setting 'align' defined in the image properties form in ckeditor.
Incidently, im grabbing the width that ckeditor sets on the image and applying that to my container so that i can float the text below.
http://austinpost.org/neighborhood-news-bites/test
Another possibility is that we could store a float value, left or right, as a formatter setting... But that would then be persistent across all displays of that image and loose the flexibility of positioning within wysiwyg.
This is a new case, but my initial impulse to wrapping this entity was to try field_groups, need to look into why but this just outputs nothing.
Comment #5
DaneMacaulay commentedHeres an example of using ckeditors declarations from the image properties form to apply styles to the image's parent container:
Comment #6
arthurf commentedI think doing something like this in media_token_to_markup() might be viable:
I think this would work to handle the left/right correctly. We would need to remove the width/height from the $tag_info['attributes']['style'] I'm guessing.
Comment #7
DaneMacaulay commentedyep, though it might be necessary in some cases to pass the width to the wrapper as well, because to float text below the image we need a fixed width parent.
in most cases we can style width by the class:
'media-' . $element['content']['file']['#view_mode']but if the image proportions are changed via wyswig image properties then we have whitespace.
the rest of my hook function, if wysiwyg doesnt set the width i fall back to width of image as it is
Comment #8
ParisLiakos commentedi am gonna commit #2, lets talk about inline styles in another issue (#1885432: Figure out a way to keep markup output consistent in media embeds)
#2 is a no-brainer for now
Comment #9
ParisLiakos commentedcommitted here
http://drupalcode.org/project/media.git/commit/65032f7
thanks!