I'm trying to insert a link to a media file into a wysiwyg text field, to show the file name as link text and the file url in Drupal's public files directory a s ink target. What i get inserted into the wyiswyg text field, though, is a small file type icon without any text or link target.
(fresh D7 install with only wyiswygapi+ckeditor and media.module enabled and configured, see below)
This is a small but very important requirement for content authors, when using media to handle assets and their embedding into content.
After trying to solve this, i finally cam to thinkthat it is a bug in the wysiwyg-(api-)-integration javascript of media.module 2.x.
Is anybody able to reproduce this?
Do i miss some important step or config?
How can we fix this?
------------
I used these steps:
drush si
drush en media wysiwyg
configure "filtered html" format to use media tags replace filter (as last filter).
configure wysiwyg to have media browser button.
configure default file display settings of text type to "Generic file".
add a page node, click media browser button in ckeditor, upload a plain TXT file.
I currently have installed these versions in the local dev environment:
Drupal 7.12
Wysiwyg 7.x-2.1
CKEditor 3.6.2.7275
Media 7.x-2.0-unstable3+47-dev (2012-Apr-19)
Chaos tool suite (ctools) 7.x-1.0+16-dev (2012-Apr-25)
File entity (fieldable files) 7.x-2.0-unstable3
Comments
Comment #1
RobW commentedThis is a known issue. Media only supports images (and some image centered workarounds in media_vimeo/youtube) in the WYSIWYG right now. See:
#1451316: Clean up wysiwyg-media.js
#1283844: [meta] Improve WYSIWYG integration
#1016376: Expose the media types allowed for WYSIWYG variable in the UI
If you want to use all of the default file types and formatters, file fields are the way to go.
Comment #2
danielnolde commentedI don't think this issue is duplicate since it adresses a very specific and important issue, that may have a very specific solution.
As i understood before, this is an issue of supporting CKEditor which can't handle tag-replacement for [[media-embed-codes]] other than < img >.
Why, then, not just insert a link to the into the wysiwyg text field file instead of an [[media-embed-code]] ??
Is there another way to solve this? Cause this has to solved, quickly.
I'd be glad to help out, if anyone points me to where to start.
Comment #3
RobW commentedMy experience is that CKEditor through WYSIWYG API handles media embed codes fine. Check out Media Vimeo for an example. The problem as I understand it is with the current formatters, and how to render a piece of media with all related media information (view mode, etc) without making the WYSIWYG choke.
I agree, it would be great to have the link formatter work right now. This seems like the same request as a bunch of other issues (e.g., #1503274: link to pdf files with wysiwyg) that have been marked as dupes to avoid splitting patch writing effort across a number of issues, but I'm fine with letting a maintainer decide.
(p.s: You can make
<html>tags display normally by wrapping them in<code>tags.)Comment #4
devin carlson commentedAs RobW mentioned in #1, this issue is a duplicate of #1283844: [meta] Improve WYSIWYG integration which is being worked on (and has a working patch) in #1451316: Clean up wysiwyg-media.js.