Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I've created a view to list some files which were attached to nodes.
Now at first I checked 'Link this field to its node' which returns the correct path systems/files/pathtofile/file.ext
But I couldn't influence the target of the anchor so I thought I'd use 'Rewrite the output of this field';
<a href="/[filepath]" target="_blank" title="([title] - [filesize] - [timestamp])">[description]</a>
The [filepath] pattern returned is linking to sites/all/default/files/pathtofile/file.ext :(
Is this a known bug and are there workarounds other then using a .tpl?
Cheers
Comment | File | Size | Author |
---|---|---|---|
#4 | views-fileurl.patch | 1.32 KB | dawehner |
Comments
Comment #1
Bartezz CreditAttribution: Bartezz commentedOops... shouldn't use scroll when the focus is on select boxes :)
Setting to correct version.
Comment #2
flokli CreditAttribution: flokli commentedalso the same when selecting "Link this field to download the file" in Upload:Description.
This is very annoying; i have a "Downloads" page which searches through all news with an attachment.
The view will always display the absolute Link to the file, so download counting modules won't work!
Any way to change it?
Comment #3
Bartezz CreditAttribution: Bartezz commentedHaven't found a solution, sorry.
Still waiting to hear from a maintainer :(
Maybe changing priority helps?
Cheers
Comment #4
dawehnerThis is a normal feature request.
There is a big difference between
* Filepath
* Fileurl
Comment #5
flokli CreditAttribution: flokli commentedthanks for your patch!
I applied it, but where can I now select "The url of the attached file."?
And the "Link this field to download the file" checkbox should always use the url, not the path of the file...
Comment #6
dawehnerThis is another token.
The link field should work
Comment #7
merlinofchaos CreditAttribution: merlinofchaos commenteddereine's solution is sensible. Committed to 6.x branches; needs port to 7.x
Comment #8
dawehnerAnd ported.
Comment #9
Bartezz CreditAttribution: Bartezz commentedThanx all and have a good weekend!
Cheers