On a view (content) I try to output my video field (file) as a link to the content. When I activate 'Output this field as a link' I always get a link to the file (/media/fid), no matter what path I enter.

This happens only with the Styles (Module) formatters 'rendered file' and all the 'file styles'.

With the formatter 'filetype icon' the link output is correct.

Any idea where to troubleshoot? Style issue?

Comments

peteruithoven’s picture

You can link rendered files by rewriting it's output and making it link to the path of the node.

Add "Path" to the fields, exclude it from display and select Use absolute link (under rewrite results).
Edit the file field, under rewrite results you will find a output this field as a link option, select it. Fill in the "[path]" replacement pattern.

I find it weird that this is so hidden, because for me, it's a very common use case.

rnyberg’s picture

As of the latest version. Rewriting no longer links the rendered file. Even making a full rewrite of the field, the file div stays outside the anchor element.

Webbeh’s picture

Status: Active » Needs review

http://drupal.org/node/1858036#comment-6837882

This solves the issue. This is an issue with File Entity, not with Views.

mjk3r’s picture

Had the same problem

In Views 7.x-3.5.....
- Media module installed
- have content type "Video"
- it has a field "Video" which takes URL from youtube or vimeo

----

#1 (using absolute path) didn't work for me.

However I got it done by:
1. add field "Nid"
- link it to original piece of content
- exclude from display

2. Rewrite Video field output as follows:
- Output this field as a link
- Link path: node/[nid]

hope it helps even 1 person

with all the best

Chris Matthews’s picture

Version: 7.x-3.3 » 7.x-3.x-dev
Category: Bug report » Support request
Issue summary: View changes
Status: Needs review » Closed (works as designed)