I am using the WYSIWYG module to load TinyMCE 4.x, I am then uploading an image via the Media button in the toolbar of TinyMCE finally I am using LinkIt to link the image to a location.
All of this is fine inside the WYSIWYG editor, but once it is published and viewed on the page the wrapping <a>
tag is stripped.
So in the editor if I view the source I see:
<a href="/my-exciting-page/index.html">
[[{"fid":"7","view_mode":"default","fields":{"format":"default","field_file_image_alt_text[und][0][value]":"","field_file_image_title_text[und][0][value]":""},"type":"media","link_text":null,"attributes":{"height":376,"width":640,"class":"media-element file-default"}}]]
</a>
However once this is rendered to the template I see simply:
<img height="376" width="640" class="media-element file-default" typeof="foaf:Image" src="http://example.org/sites/default/files/miscl.jpg" alt="" />
If I then edit this piece of content again and view the source of the WYSIWYG editor the <a>
tag is definitely still wrapped around the Media module's little string of JSON.
In a bid to prevent this from happening I changed the Wysiwyg Profiles and Text Profiles so that they don't remove broken tags or attempt to clean up an HTML or introduce any of their own HTML. Unfortunately this has had no effect.
Is there some way that Media/Drupal/WYSIWYG/LinkIt can be setup so that it will allow images to be linked? I have been unable to find a relevant issue or patch floating about out there on the web either.
Comment | File | Size | Author |
---|---|---|---|
#50 | linked_images-2357993-50.patch | 4.7 KB | joseph.olstad |
|
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #2
gmclelland CreditAttribution: gmclelland commentedI don't think TinyMCE 4.x is supported yet with the wysiwyg module. Maybe you can try 3.5.8 and see if it works?
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commented@gmclelland the WYSIWYG editor is working fine with the wysiwyg module with the appropriate patch mentioned in their documentation. This looks an issue with the conversion of the Media tags. Manually inputting the link and image via HTML source works just fine and saves to the DB so this doesn't appear to be an issue with the editor or the filters that are enabled in the wysiwyg text format/profile.
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedHaving looked more closely at this it looks like the issue is actually that the image is being wrapped with code and contextual links. This appears to then break the
<a>
wrapping the image.So the problem line of code causing this is in media_wysiwyg.filter.inc within the
media_wysiwyg_token_to_markup()
function. Towards the bottom it attempts to make a decision of whether or not to add wrappingdiv
s to the image:Unfortunately, in my case
count(element_children($element['content']))
returns 2 even though there is only one media element in there. This is because in contributions/file_entity/file_entity.file_api.inc thefile_build_content()
function ( http://drupalcontrib.org/api/drupal/contributions%21file_entity%21file_e...) it is adding an array index with the key "links".So even though there aren't multiple elements it still tries to wrap the image with
file_build_content()
is always returning two array keys that aren't prefixed with a#
. This is apparently the way thatelement_children()
knows what to extract from the array - it ignores keys prefixed with a#
.Anyway tl;dr the contents of that
if
statement are always executed no matter whether there are multiple media items or not. Can we just bump this check to greater than 2 or is there another reason this is set to 1?Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedThis issue is mostly caused by the file_entity module. To work round this I have restricted the view modes available to media_wysiwyg in /admin/config/media/wysiwyg-view-mode. I have set images to only allow the WYSIWYG view mode like so:
or alternatively see http://imgur.com/WorqfOT
I have then created an override template for the file entity called
file--image--wysiwyg.tpl.php
(see https://www.drupal.org/node/1793548) and I have the following code in it:This has now removed all the annoying links, headers and wrapping
<div>
s from the output EXCEPT for the media_wysiwyg wrapping<div>
mentioned in comment #4.As this is just one wrapping
<div>
and the page is HTML this now no longer breaks the link, but it would still be preferable to be able to remove this annoying wrapping<div>
.Comment #6
theMusician CreditAttribution: theMusician commentedI can confirm this is an issue as well with CKeditor 4, file entity 7.x-2.0-beta1, and 7.x-2.0-alpha4. Treffynnon's fix does not seem to work with this setup either.
Comment #7
ayalon CreditAttribution: ayalon commentedThanks @Treffynnon for debugging this and for the fix. I also invested hours but did not come to your solution.
@theMusician:
Treffynnons solutions works but he forgot to mention one important step.
You need two template files, because of a long existing bug in drupal:
file--image.tpl.php (copied over form file_entity.tpl.php)
file--image--wysiwyg.tpl.php (see above)
The second file only works, if you have the first file in your theme folder. Then clear the cache and your ready to fly also in CKeditor
Comment #8
theMusician CreditAttribution: theMusician commentedThanks for the tip @ayalon. I'll give it a try when I do my next set of upgrade tests.
Comment #9
Zythyr CreditAttribution: Zythyr commentedI think I am having a similar issue: https://www.drupal.org/node/2378685
What are these template files and where do I get them? And where to I put them?
file--image.tpl.php
file--image--wysiwyg.tpl.php
Will that resolve the issue I am having? Will Media module be updated to resolve this issue?
Comment #10
BrightBold@zythry - You copy /sites/all/media/modules/file_entity/file_entity.tpl.php into the templates folder in your theme, and rename it file--image.tpl.php. Then, you make a copy of that, also in /sites/all/themes/yourtheme/templates, and name it file--image--wysiwyg.tpl.php (or replace "wysiwyg" with name-of-your-view-mode if your view mode isn't named wysiwyg, using a single hyphen in between words if your view mode has multiple words in its name). You edit the latter template as desired.
Comment #11
Zythyr CreditAttribution: Zythyr commented@BrightBold
Sorry I don't have a way to test it at the moment, but will your suggestion fixed the issue that I posted here: https://www.drupal.org/node/2378685
If so, why isn't Media module being updated to fix this issue? (I am sorry if I asked a stupid question, I don't know much about development).
Comment #12
Zythyr CreditAttribution: Zythyr commented@BrightBold
I just did what you said, however, instead I copied the file into /themes/bartik/templates because I am using the default theme. Bartik doesn't exist in the /sites/all/themes/ folder.
Your suggestion still didn't fix the issue I posted here: https://www.drupal.org/node/2378685. I looked at the HTML code in the Ckeditor by click on the "Source" button. It inputs the IMG tags properly, but there is no A tag created for linking...
Comment #13
pdcrane CreditAttribution: pdcrane commentedI'm having this same issue as well. Treffynnon's fix worked perfectly for me.
Running:
Media 7.x-2.0-alpha4+14-dev
File Entity 7.x-2.0-beta1+13-dev
WYSIWYG 7.x-2.2+54-dev
CKEditor 4.2.0.f74e558
I patched two Media module files:
/media/includes/media.filter.inc
/media/modules/media_wysiwyg/includes/media_wysiwyg.filter.inc
to change:
if (count(element_children($element['content'])) > 1) {
to
if (count(element_children($element['content'])) > 2) {
This resolved the issue for me across the board. No template changes necessary.
Comment #14
drupal a11y CreditAttribution: drupal a11y commentedWithin "Media 7.x-2.0-alpha4+19-dev (2015-Jan-08)" and also the named version above I can´t find a "media/includes/media.filter.inc"-file.
There´s only the one in "media/modules/media_wysiwyg/includes/media_wysiwyg.filter.inc".
Patching this file without additional theme-templates does not solve the issue for me.
I tried these versions:
Media 7.x-2.0-alpha4+14-dev / Media 7.x-2.0-alpha4+19-dev
File Entity 7.x-2.0-beta1+13-dev
WYSIWYG 7.x-2.2+54-dev
CKEditor 4.4.3 / 4.4.6
Also I have "Media WYSIWYG View Mode" disabled.
Comment #15
drupal a11y CreditAttribution: drupal a11y commentedI also found out that the "formats order" is important for the resulting markup: admin/config/content/formats/
1. Convert URLs into links
2. Convert line breaks into HTML
3. Convert Media tags to markup
Otherwise the markup has unwanted results.
Comment #16
focal55 CreditAttribution: focal55 commentedThanks @mori, the format orders fixed the issue for me.
Comment #17
BrightBold@Zythyr - We should be addressing the other problem you're experiencing in its own issue, rather than cluttering up this one (although it seems to have been deleted? The links you posted don't work). My instructions were to help implement Treffynnon's workaround for this issue as posted in #5.
But, as an aside, you shouldn't be modifying Bartik as you will lose all your changes when you upgrade Drupal. Instead, follow the instructions for creating a sub-theme of Bartik and move all your modifications over to your new child theme.
Comment #18
lecler CreditAttribution: lecler commentedSame problem for me.
My workaround :
Comment #19
AlMiesel CreditAttribution: AlMiesel commentedlecler, thanks this worked for me!
Comment #20
denix CreditAttribution: denix commentedThanks! workaround #18 worked for me too!
Comment #21
seanpclark CreditAttribution: seanpclark commentedWhat is the use case of wrapping multiple items in a div when using a wysiwyg? The comment for the media-element-container code says "We dont want divs when there are no additional fields to allow files to display inline with text, without breaking p tags," so I'm confused because this would mean content can't be placed in a paragraph tag because it will get ejected by the browser. An img tag, however, is valid on an intra-paragraph level.
Comment #22
dasginganinjaSean P. Clark, I think that it could be used for things like contextual links. Just as an example.
Comment #23
seanpclark CreditAttribution: seanpclark commentedFor contextual links, there is a separate wrapper (contextual-links-wrapper) for that purpose.
For multiple fields on a media item, a field group can be used instead – that’s the only situation that comes to mind for me.
Isn’t count(element_children($element['content’])) going to always return > 1 because it’d include ‘file’ and the ‘links’ array? Maybe the original intent was to do as #13 mentioned and check if count is greater than 2. Either way, I prefer the media-element-container wrapper be omitted (in favor of field groups) if the idea was to just wrap multiple fields.
Comment #24
eigentor CreditAttribution: eigentor commentedThe combination of #13 and an extra template file named file--image--wysiwyg.tpl.php solved the issue.
Using the latest CKEditor 4.5.2 and File Entity 7.x-2.0-beta2
Inside the template I chose a rather radical approach like described by treffynon in #5, removing all div wrappers and just having
I did this because in my use case I have no extra fields around images in text areas and I don't want contextual links.
Then there was the extra div around the media element with the class media-element-container that cannot be removed by just creating the template. This is removed by changing media_wysiwyg.filter.inc like described in #13. This appears to be clearly a bug, as pointed out by treffynon in #4.
In my case raising the count to 2 was enough.
It seems like file entity went a bit overboard here. The use case of multiple fields in a media element are to be solved, like when you have captions and stuff, but creating problems for simple images inserted into text areas by wrapping a lot of unnecessary html around it. And this specifically in the wysiwyg view mode that is meant to cater to Wysiwyg editors.
Comment #25
dasginganinjaUsing the above instructions in #24 got this working for me. I do also feel that this is a bug as there is clearly a logic error.
For the time being I'm including file.tpl.php and file--image--wysiwyg.tpl.php in my base theme along with a patch for media_wysiwyg in the Drush make file until this is resolved.
Comment #26
joelstein CreditAttribution: joelstein commentedFYI, to also remove the wrapper DIV provided by Media, you can do something like this in a custom module hook (it won't work in a theme's template.php file, because theme don't have access to drupal_alter() hooks):
Ideally, though, Media wouldn't add these tags if using File Entity as the render method unless the element_children() were greater than 2 (not 1).
Comment #27
makbeta CreditAttribution: makbeta commentedIMHO media module should give users an option what type of a tag should it wrap content or not render any at all. Alternatively the wrapping tag should at least be a , which is the same block type element as an <img>, thus not rendering illegal markup by default.
Here is an example of a case where I don't want media module to render any tags. I created my own caption field and used the file entity module to do the markup of image & caption. Using <figure> & <figcaption> tags. While my element now will have more than 2 children I still don't want the wrapping <div> to show up because I already have all the markup I need.
Comment #28
rich_dawson CreditAttribution: rich_dawson commented#26 works for me, thank you for that joelstein
Comment #29
DigitalFrontiersMediaAs a quick workaround, going to /admin/config/media/browser, selecting "Legacy Rendering", saving configuration, and clearing caches will likely fix the broken anchor tag wrappings...without the need for swapping out file entity tpl.phps and such.
Comment #30
vood002 CreditAttribution: vood002 commentedInterestingly I'm having this issue with the dev version of media and TinyMCE 3.5.8. I've tried all of the above solutions with no luck.
A little perplexed here. Looks like most of this thread is using CK so I'm assuming that's where my issue comes from. If anyone has any suggestions I'd appreciate them. Thanks!
edit: formatting
Comment #31
jbiechele CreditAttribution: jbiechele commentedThis is just to confirm that the workaround from DigitalFrontiersMedia in comment #29 fixed it on my site. Thank you very much for the hint!
Comment #32
kobuk CreditAttribution: kobuk commentedFollowing #29 also removed all the extra markup for me.
TinyMCE 3.5.8
wysiwyg 7.x-2.2
Media 7.x-2.0-beta1+9-dev
File Entity 7.x-2.0-beta2+13-dev
Comment #33
davidwbarratt CreditAttribution: davidwbarratt at Golf Channel commentedI'm trying to think of a way to fix this for everyone and the only thing I can think to do is take the WYSIWGY view mode and (by default) strip out all the wrappers from the template. If someone wants them back in their template they can add them back, or if they want to use a different view mode they can remove them.
Does that sound like a plan?
Comment #34
DigitalFrontiersMedia@davidwbarratt : sounds reasonable to me but I don't think I deal with it enough to anticipate any of the consequences. So I'd like to hear other thoughts on the matter.
Comment #35
davidwbarratt CreditAttribution: davidwbarratt at Golf Channel commentedPerhaps something like this?
Comment #36
davidwbarratt CreditAttribution: davidwbarratt at Golf Channel commentedAttached is a patch for the current stable release
7.x-2.0-beta1
.Comment #37
Fabianx CreditAttribution: Fabianx at Tag1 Consulting commentedThere is another way to circumvent this: (untested, but should work)
Could also use file_view_alter() with a high weight instead if there is conflict with contrib modules trying to add to 'links', e.g:
Comment #38
brockfanning CreditAttribution: brockfanning commentedIn my opinion it's going to be impossible to have a solution that keeps divs out of the rendered file entity. As has been mentioned, the stock file_entity template has div wrappers, and the media module also adds a div wrapper. On top of that, any fields that are output along with the file entity will have div wrappers around them too. Of course it's possible to override all of the related templates and control the markup such that there are no divs, but we can't expect everyone to go to those lengths.
I would take a step back and look at what the actual problem is. I don't think there is a problem with divs being inside of anchor tags. HTML doesn't mind this. Unless I'm mistaken, the problem is when the file entity appears inside an anchor tag inside a paragraph tag. The divs, in that case, cause browsers to close the opening paragraph tag just before the opening div, which is after the opening anchor; and that causes the anchor to close, and things get wacky. So for example this:
gets changed (in the browser) to this:
So one option might be to ensure that media tokens don't get wrapped in paragraph tags, which is what I've tackled here: #2707107: Cannot put link on an image added with media
I do think that #18 above is an issue. HTML definitely does not like anchor tags inside of anchor tags. Personally I think that the stock file_entity template should have that link removed. But, at this point it's possible that some sites rely on it.
Comment #39
suffering drupal CreditAttribution: suffering drupal commentedAfter a decade of being stuck it still strikes me how Drupal manages to frequently turn even the simplest things into dramaticly complex and despairing.
More so with Media, which I only have dared to use as is because all of the problems it generates if you touch anything. But after leaving it for lost for some years, I now spent two days on something as basic, simple, and stupid as adding a link to an image! Something so fundamental you just can't get around it.
Anyway I just wanted to confirm that #29 finally allowed me to actually have a link from images indeed!!! To be more specific, personalized still images from videos to those videos. What I am not sure of yet, is if it has broken anything somewhere else.
Now I wonder why the "Full file entity rendering" actually exists and is even default, with all the problems it delivers, as the many and years-old issues confirm. I guess one of the many misteries of Drupal. I just hope it will not take days or years again to discover the next step: how to open those videos either in lightbox or colorbox, although the first tryouts doing as told do not give any results as promised or expected either.
Comment #40
daften CreditAttribution: daften at District09 commented@brockfanning, so basically this can be closed as a duplicate of #2707107 ?
Comment #41
joseph.olstad?
#2707107: Cannot put link on an image added with media
Comment #42
joseph.olstad@daften , it looks like there's a configuration that fixes this, please try this:
Configure the media_filter_paragraph_fix filter as described:
Comment #43
joseph.olstadIf anyone is still experiencing this, please upgrade to the latest version of media
and also upgrade to the latest version of file_entity
otherwise is a possible duplicate of #2707107: Cannot put link on an image added with media which also may be resolved by upgrading file_entity and media
Comment #44
othermachines CreditAttribution: othermachines commentedI've also been tackling the problem of image mark-up being rendered outside of
<p></p>
tags after being embedded in the wysiwyg editor. My solution is below, which is basically an amalgamation of various suggestions provided above.Edit: Solution in #42 unfortunately won't do in my case since it doesn't prevent alignment classes from being added to the paragraph tag (by image2, I think?) in the editor. Enabling the filter just removes the paragraph tag which removes the formatting.
1. Copy file_entity/file_entity.tpl.php into your theme folder and rename it file--image.tpl.php. Replace contents with:
2.
In your theme's template.php file, add the following (replace THEME with your theme name):Add the following to a custom module* (replace MODULE with your module name):* NOTE: When this hook was in my theme's template.php file it didn't always load in time to be triggered on all media elements. It works more reliably in a custom module.
3. Clear caches.
Before:
After:
Tested with:
media 7.x-2.0-beta14, 7.x-2.0-rc5
media_ckeditor 7.x-2.0-alpha4, 7.x-2.0-rc3+1-dev
Comment #45
joseph.olstad#44
Comment #46
joseph.olstadhad a closer look, alternatively, this would be done best as it was done in patch #35
https://www.drupal.org/files/issues/linked_images-2357993-35.patch
However, patch #35 needs to be rerolled due to changes made since beta8 , media_wysiwyg_view_mode was deprecated and its logic was moved.
So patch #35 is actually the correct approach IMHO, however it needs refactoring. Patch #35 approach would be best because it does not require a custom theme tpl in a theme , rather the tpl would be handled by us in this module as we'd provide the tpl in this module as is done in #35.
Comment #47
joseph.olstadpatch #35 needs a reroll / refactoring as I mentioned. media_wysiwyg_view_mode was deprecated , the same logic should go probably into media_wysiwyg instead
Comment #48
othermachines CreditAttribution: othermachines commentedHi, @joseph.olstad. I wasn't actually suggesting #44 as a fix, but a workaround. :)
If you're going to revisit this I would suggest looking at whether to adjust the count (or find some other way to determine if there are multiple images) in
media_wysiwyg_token_to_markup()
as first suggested by @Treffynnon in #4. It's a small change that at the very least would prevent people from having to implement a hook in order to get rid of all of the block-level elements wrapping the image (which seems to be the root of the problem).Thx for your hard work on this module!
Comment #49
joseph.olstadyes #44 is a valid workaround, no problem, just prefer that we deal with it in the module similar to patch #35 (needs reroll/refactor) . Patch #35 will apply to versions up to beta7 however needs a reroll for beta14
Comment #50
joseph.olstadhmm, ok I've refactored patch #35 into patch #50
However now after reading the @FabianX suggestion he suggests another way to resolve this. Not entirely sure which would be the best way yet.
setting #50 for review, I have not actually tested it yet, just a straight reroll /refactoring of #35
Comment #51
joseph.olstadComment #52
joseph.olstadOr, actually #29 proposes a solution that does not require a patch. Perhaps proposed solution in #29 is the best because no code change is required in that case.
more testing needed
Comment #53
bpadaria CreditAttribution: bpadaria commentedupdating media module to latest version i.e. 7-x-2.0-beta14 solved mentioned problem for me.
Comment #54
joseph.olstadmarking as support request fixed
Comment #56
peterg.griffin CreditAttribution: peterg.griffin commentedNumber #29 works. Thanks!
Comment #57
themaurice CreditAttribution: themaurice commented#18 works great thanks
Comment #58
joseph.olstad@themaurice and @peterg.griffin, what version of the media module are you using? @bpadaria says that upgrading solved the problem. Just wondering if this is a regression since beta14 or if you're using something older than that. Currently we're at rc12. Are you using rc12 ? or something older than rc12?
Comment #59
capysara CreditAttribution: capysara commentedI just updated to 7.x-2.0-rc12 and tried the #50 patch. It applied, but it doesn't appear to have worked. My images still don't link.
However, #29 worked! Thanks!
If I'm understanding correctly, #45 & #46 of this issue provide a a good summary of the history of the issue: https://www.drupal.org/node/2194821#comment-9842871 and https://www.drupal.org/node/2194821#comment-9927904.
My question is... if enabling "Legacy rendering" (#29) is a workaround, how do we "switch over to the new rendering"?
Thank you for all the hard work on this!!
Comment #60
veronicaSeveryn CreditAttribution: veronicaSeveryn at Inclind Inc commentedI am using:
MEDIA 7.x-2.0-rc12
FILE ENTITY 7.x-2.0-beta3
WYSIWYG 7.x-2.3+16-dev (from 2017-03-06)
and the link around MEDIA markup doesn't work for me if applied as is, without any patches to either of the modules. The result will be element rendered by itself, not around media produced markup.
I have followed CONFIG change suggestion in comment #29 and it worked.
Comment #61
brockfanning CreditAttribution: brockfanning commentedIt's been a while since I looked into this, so I can't guarantee all this is 100% accurate, but here are some ideas:
If you are not using "legacy" mode, then the full file entity is being rendered. Here is the default template file that is used for file entities (minus all the comments), file_entity.tpl.php:
The main thing to notice is that inside the
<h2>
there is an<a>
.Which means that if you put a link around some embedded Media, and you are not using legacy mode, and you have not overridden the default file_entity template... then you are going to be rendering a link within a link.
Browsers don't like that, so they (the browsers) try to move things around until it makes sense. This is what gives it the weird behavior where the link does not appear to be around the media, when viewed in a browser "Inspector". However, I think that if you look at the source of the page (such as with CTRL+u) you will see the markup is actually as you would expect (albeit invalid) with a link around a link.
So, if you don't want to use Legacy mode, and you need to have linked embedded Media, you could try overriding the file_entity.tpl.php template in your theme, and remove the
<a>
tag.Admittedly this is a lot of words just to get linked media... but hopefully this is helpful.
P.S. Yet another option (and what I have done in the past) is to have a custom field on the file types for a link, and use custom code to wrap the rendered media in that link.
Comment #62
joseph.olstadThanks @brockfanning, your explanation clarifies this perfectly.
Comment #63
joseph.olstad@brockfanning, we should add your explanation to the documentation pages.
Here
https://www.drupal.org/node/627244
or here somewhere
https://www.drupal.org/node/1793548
Comment #64
StephenRobinson CreditAttribution: StephenRobinson commentedcan remove the media div:
Comment #65
joseph.olstad@StephenRobinson, curious, have you tried this with the 7.x-3.0-alpha7 release as well?
Comment #66
riskid CreditAttribution: riskid as a volunteer commented#29 worked for me!
Comment #67
emerham CreditAttribution: emerham as a volunteer commentedWhat if we add a link field to the Media browser's final page where you select the display mode, alignment, Alt Text and Title text that could be a URL. That way while you are finalizing you image you can add the link there and then it could be rendered outright. Then we could in theory add LinkIt to this field if the site has it enabled, or some admin page that would allow them to select either text field or linkit as the option.
Comment #68
othermachines CreditAttribution: othermachines commented@emerham - You should post your idea as a feature request.
Comment #69
emerham CreditAttribution: emerham as a volunteer commentedok I'll add it as a feature request and look at getting some patches created
Comment #70
joseph.olstada new release is comming shortly .
see :
#2881204: Add link field to Embed Page
Comment #71
commonpike CreditAttribution: commonpike commentedOK, we now have a link field in the Media browser's final page.
I don't think that is a solution. It's in fact obfuscating things. It is not clear for the editor that using the link icon in the wysiwyg editor will not work as expected. But it's also confusing on other sorts of media (link on an audio element?) or displays (link on the link display ?). So I disabled the field (which is a setting, hurray), and now I am still stuck with this problem.
Solution #44, which is simply
override the default file_entity.tpl.php in your own theme to not use block elements and dont show links
is just fine.I don't understand why the media module insists to use block elements and links in their file display, even if it's clearly a problem. Why make things so complex ? But if you must, couldn't you provide an optional, more suitable template, at the same place where 'legacy display' is now provided as an option ? Like
The inline display could be default when using wysiwyg, or something.
Comment #72
marcoka CreditAttribution: marcoka commentedswitching to legacy mode isnt really good fix. but i have that error now too after updating all modules to the latest versions.
i also added the media paragraph fix filter and added it above the media filter. did not change anything.
media:Version: 7.x-2.10
file-enity: Version: 7.x-2.4
the code generated on source is
and the final code is broken
i guess overriding that file_entity template seems to be the only good solution so far :(
So i copied "file_entity.tpl.php" to my "themes" "template" folder and removed:
Then i can link images with a tags or with the linkit module
Comment #73
RAWDESK CreditAttribution: RAWDESK commented#29 solved it too for us, but I am trying to find the view mode settings as indicated by #5 at admin/config/media/wysiwyg-view-mode
This path is no longer accessible (after 4 years).
I would like to have WYSIWYG as the default format to be presented when embedding a file in textual content.
Reason:
After upgrading from 7.x-2.0-unstable3 to 7.x-2.19, horizontally aligned image embeds are by current default format no longer rendered as such but wrapped to next line instead.
Is there still a way to set this somewhere because I cannot find it anymore ?
Comment #74
capysara CreditAttribution: capysara commentedIt looks completely different, but I think this is what you're looking for: /admin/structure/file-types/manage/image/edit "WYSIWYG view mode" is a select list towards the bottom.
Comment #75
wranvaud CreditAttribution: wranvaud at Phase2 commented@RAWDESK if it could help you or someone else here:
To restrict view modes go to each or the view modes and check the box at the bottom "Restrict in WYSIWYG" /admin/structure/file-types/manage/image/file-display
The view mode setting indicated by #5 is now separated into each view mode rather than being centralised in that page.
Comment #76
tyler.frankenstein CreditAttribution: tyler.frankenstein commented#61 is a great explanation and worked for me!
Comment #77
andrewozoneI was working through this issue with Content Editors, and found that comment #61 explanation helped to solve our problem adding a link to an image. To fully resolve this issue, I commented out the following HTML in the template file file_entity.tpl.php.
<!-- <h2<?php print $title_attributes; ?>><a href="<?php print $file_url; ?>"><?php print $label; ?></a></h2> -->