Summary: Many people want the ability to create File displays, such as preview images, that link to the content that houses the file. Comment #16 below points out that File Entity Link offers this feature, and it was suggested (comment #21) that given the high level of demand for and expectation that this feature exists (it being analogous to how images are handled), and the simplicity of the module's logic, File Entity Link could become part of File Entity. The File Entity Link maintainer supports this idea (comment #23).
A workaround is also proposed in comment #15
Original post: I have created video upload with CCK to use YouTube video urls. I have then created a view to filter this but unfortunately on the views page all I get is a preview picture which does nothing when you click on the picture. Have I done something wrong here?
Comments
Comment #1
dave reidComment #2
Road Kill commented!!!
Comment #3
Road Kill commentedIs this module even still maintained it appears that the maintainers of this module do not even bother to reply.This must be the second posted issue and my last issue was posted last year Uninstalling.
Comment #4
arthurf commented@Road Kill please feel free to jump into the issues queues and work on this module. There are many people who have devoted time to this project. While I understand the frustration of not getting an answer the people who work on this project due so out of their own good will. Please be respectful of other people's time and energy.
Comment #5
dave reidYes this module is maintained, but I generally don't respond to people that are rude, abuse the category and priority fields, and expect instant gratification from an open source project.
Comment #6
tsvenson commented@Road Kill: Please click on this link and you will quickly see the activity around this module when it comes to developing it.
Comment #7
Road Kill commentedIf I have offended anybody of the maintainers of this module then I am sorry but that was not the intention. As maintainer you need to understand that I am very happy to help and test this module but not replying to issues is not conducive to solving issues.
David I am very aware that this project is open source and I do not expect instant gratification. I am one of those people in the Drupal community that thinks a sustainable system should be in place to make Drupal module development more viable. Have you noticed how many modules are sitting on Drupal with no activity for the last 12 months just how sustainable is the current way of doing things.
I would be only too happy to pay a yearly licence fee to use a Drupal Module if such a remuneration system was in place.
My last issue that was submitted October last year and it was only two people who responded and wrote a whole novel about how they are unhappy with the module.
I do appreciate the energy and time that maintainer put into these Drupal modules and although I am not a maintainer of a module I have made my contributions to the Drupal community where I can be it through a patch or just sharing with the new kid on the block.
I understand how busy you guys are and am I very aware of the how busy the issue queue for this module but I also cannot wait four months for an answer.
David is a very busy guy and the time that he has put in to this project is commendable.
Comment #8
aaron commentedwe were talking about implementing a media bug squad, similar to the views bug squad at http://drupal.org/node/945414, which should help keeping issues from being forgotten about.
I'm going to respond to this specific issue in my next update, so as that it doesn't get confused with this specific response.
Comment #9
aaron commentedYou can usually configure views to link through an image in the field settings for that specific field. It would be helpful to know specifically what behavior you're looking for, as there may be different solutions according to what your trying to do: Do you wanted to click through to the YouTube video page? To the file page on your local system? Or to expand into an embedded video? Or maybe a colorbox?
In any case, none of that is in the realm of the media module, which does nothing to help display a file. I'll move this to the media: YouTube module for now.
Comment #10
aaron commentedComment #11
adamdicarlo commentedI'm guessing the OP was trying to make the YouTube preview image link to the node (or other entity) the file field is in.
That's what I'm trying to do, and while I can create a file style and set the file style to "Linked [image style]," the link goes to the media (the file entity) -- e.g. the internal path "media/18." I don't see a way to display the YouTube preview image and make it link to content (node) using normal node view modes and file styles.
Is there a way to do this, or would I have to use Views? Or write a custom file style or field formatter or... I'm not even sure what?
Comment #12
walkero commentedI solved this issue by creating a specific node--video.tpl.php where I added the following code
and before the rendering of the content I added,
This way the video preview is linked to the node content.
Comment #13
AFFLemos commentedHi,
Mediasaur and me just solved the same issue i had.
In Views-> Format-> Show -> Try using fields or panel fields.
Now in the field area show your content type: images and direct link to content.
I hope it solves the issue.
Comment #14
dgastudio commentedin views, add new field: path and place it it BEFORE your media field.
in your media field, "rewrite results","Rewrite the output of this field " and add something like: [field_video].
Comment #15
alanom commentedFor me (using stable 7.1 branch), kervi's suggestion didn't work, the only formatters available to me in views link to Media and this
<a>markup from the formatter causes Views to reject my custom<a>replacement markup. (using Styles module which may be relevant)It would be easy - strip HTML tags except
<img>then rewrite - but for this Views issue (tags are stripped AFTER rewriting, nullifying the rewrite). It's still pretty easy, but inelegant - I've written up how to do it as an example on comment 4 in that linked issue.Quick copied-pasted summary (assuming your Youtube field is Field: Video):
<img>but nothing else)So the second field, only if not empty, shows the first (stripped) field wrapped in its own (non-stripped) markup.
Comment #16
alauddin commentedOk, here is the solution for linking the preview image to content.
The new media 2.0 by default links everything back to the media/[fid] to make this link back to content.
1) install this module http://drupal.org/project/file_entity_link
2) in manage display select Format > rendered file > select view mode to 'preview' (or whatever you want)
3) now under Structure > File Types
/admin/structure/file-types >> manage file display for your file type (image, video etc)
4) Select 'preview' tab from manage display
5) Select 'youtube preview image'
6) and CHECK BOX to "Link file to referencing entity" now available via the above module.
hope that helps.
Alauddin
ps - this worked for me using Media Youtube, Mediafront (link preview image to node)
and you dont even need the /styles module if you tried that to get the above desired result.
Comment #17
RobW commented@Alauddin, nice helper module. Looking forward to reading people's feedback on it.
@alanomaly, a quick FYI: Styles module is no longer recommended with any of the Media modules. Media 2.x does everything Styles did with a simpler UI and less moving parts, and I think we're going to strip all Styles module code out of Media: Youtube in the 7.x stable release.
Comment #18
alanom commentedSlightly off topic comment for RobW - while the documentation surrounding styles, media styles, file styles etc is so variable, out of date and/or patchy, there's an unanswered Drupal Answers question with a bounty on it asking for an explanation or documentation on what the current correct workflow is for setting media styles for media and thumbnails in 7.1 and 7.2, do you think you'd be able to have a crack at answering it sharing the details of the current best, most stable, most future proof media styles workflows for 7.1 and 7.2?
On topic comment - while, as RobW says, styles module isn't looking future proof, in the short term it turns out after some tinkering that the default link wrapping in my earlier comment can be avoided so long as custom, not default, file styles are used, specifying the unlinked version. Not the way to go for future, but might help in the short term for those of us using the stable branch and the old family of modules for production until 2.X is stable.
Comment #19
RobW commentedOff topic reply: BAM, answer submitted. Please quality check it in the comments over there -- eventually I'd like to add this to the Media documentation.
Comment #20
RobW commentedMarked #1294380: Linking problem in "Manage Display" and #1244958: How to Link Youtube Thumbnail to node and not Media page as duplicates.
Can we consider this fixed with azinck's module File Entity Link? Documentation like comment #16 should also be added to one of the pages being created in #1699066: Revise documentation for Media 2.0; remove deprecated information, include overview and walkthrough examples.
Comment #21
alanom commentedDo we have a case for handing this over to File Entity module as a low-priority task to incorporate File Entity Link's feature? That would solve this issue, and others like it, permanently, for all Media- and File Entity- extending modules. Points in favour:
Edit: two more dupes... #1189838: Display teaser: Now links to media instead of node, #1617252: Can an inserted image be linked back to its node?
Comment #22
RobW commentedMoving this to File Entity Link's queue for review of #21. There is certainly a case for integrating this into file entity, but we should get azinck's thoughts on it first. I'd be happy to do some of the work if it's approved by azinck and the File Entity maintainers.
Comment #23
azinck commentedI'm very happy to have this functionality subsumed by File Entity. I would greatly prefer that, in fact :). If the File Entity folks want to take the approach I've done here to solve the problem then it would be trivial for them to integrate it. If they feel there's a better approach I'm happy to chat it over.
Comment #24
alanom commentedGreat! So I guess we pass this over to File Entity for their approval as a feature request for which most of the work has been done already by azinck in File Entity Link?
(unless anyone knows a more efficient way to keep this moving forward?)
I've added a summary to the original issue so people don't have to wade through too much to see what this is about.
Comment #25
azinck commentedIf the File Entity folks are happy with this approach then I can roll a patch.
Comment #26
peteruithoven commentedI would usually fix this by using the fields display mode, adding a path (absolute) and rewriting the results of the media field by creating a link out of it and then filling in [path] as link. But since the 7.x-2.x release this doesn't seem to work anymore.
The File Entity Link module does seem to work.
I don't want to be rude, but I hope I can get some attention to this issue again, since azinck asked his question in september.
Comment #27
RedRat commentedIf the File Entity folks are happy with this approach then I can roll a patch.
I can test your patch on my development installation.
Comment #28
dave reidI'm not sure we can support this functionality with rendered files, which can have complex output. I may need to look at the code again, but last I had checked, I didn't get that immediate "yes we should be supporting this natively" feeling based on the code.
Comment #29
azinck commentedFrankly, I think File Entity Link's functionality is pretty much obviated by http://drupal.org/project/linked_field
Comment #30
devin carlson commentedFile entity 7.x-2.0-alpha1 now allows you to use the Image formatter provided by the core Image module (without losing alt + title text). The core Image formatter allows you to link an image to its parent content.
I'm making this as fixed since, in my experience, linking images to content is the primary use case for this functionality and I don't believe that File entity should try to wrap formatter output in links because that can easily lead to invalid markup (as is often seen with contextual links).
Comment #31
Ravenight commentedI can't seem to make this function as you described. I am re-opening this to get a solid explanation on how to make this work.
I have alpha1 running using Views to output a grid of content nodes.
The Content node has a media field on it. I display this field in views with the "media" formatter (only choice available) and select the "teaser" view mode.
In File Entity, under "teaser" view mode and manage display I have selected "image" under "enabled displays" and in the image settings under the pull down "Link to image:" there are three options:
1: nothing - works as expected
2: content - links to the file entity's page [/file/FILE_NAME.PNG] - not the referencing node the image is attached to
3: file - links directly to the file [/sites/default/files/FILE_NAME.png]- as expected
How do I link the image to the referencing node that I am calling in views?
I have already tried re-writing the file_entity field as a link with the "node/[nid]" field. This puts an empty tag with the proper href on the page but it does not wrap around the file_entity fields.
I also tried using file_entity_link but that also did not work, nor do anything at all that I could see.
I have ended up using linked_field to make this work. It would be nice if I could do this without another module but for now, with this extra helper, I am able to make this work using DisplaySuite, and Views where I render the content in its own DS view mode with the linked field active and a token to the "node/[nid]" on the media field.
Comment #31.0
Ravenight commentedNo need to read through a lot of unrelated comments including an ugly argument to see what this issue is really about
Comment #32
tchopshop commentedI'm in the same boat as Ravenight, I made my media file image work finally with linked_field in views and thought I was done.
However, I have now incorporated the Picture module into the mix. Picture module does not work with linked_field in views for some reason. I guess I need to write on the Picture issue queue, but am also posting here, because I'm not sure which one ultimately needs to be patched.
If only the views option worked!
Update: Although it didn't work earlier, with Picture module File Entity Link is working for me.
Comment #33
kiwad commentedSeems there no active patch in this issue so marking back to active instead of need works, but maybe it should also be categorize in support request/documentation ?
Maybe worth mentionning that per comment #15 almost got it working.
I'm only stucked with my file title... but I guess I could get rid of it by rewriting my templates...
Comment #34
awm commentedI found the best way to do this is to create your custom file formatter. For example for a project of mine that uses youtube and brightcove video integration I did this