Active
Project:
Image Browser
Version:
6.x-1.0-rc1
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
13 Jul 2010 at 00:29 UTC
Updated:
3 Sep 2011 at 03:45 UTC
I'm trying to use a custom view, with filters, to insert images through the image_browser. How can I find the file Id for a CCK file-field to use? My view is set at admin > settings > imagebrowser > Views
I see in the image_browser tpl something like this <a href="<?php print url('imagebrowser/'. arg(1) .'/insert/'. $fid); ?>
How can I find the file Id for my CCK field in Views?? Thanks for any help.
Comments
Comment #1
calefilm commentedI have a file field that I've brought up in views. It's a file I want users to download
The link to the download file is: /download/file/fid/627
In the views field I want to add a link to all of these files, say: /download/file/fid/[field_example_fid]
but I can't seem to get the fid coming up in the URL. My URL always looks like this /download/file/fid/[field_example_fid] and brings me to a 404 page
How do I get the FID of a file field in views?
Comment #2
kirilius commentedI am trying to do the same but can't find a working solution. Any help from the developer is very welcome.
Comment #3
funex commentedme too. Can't seem to work it out. Is it a bug in views?
Comment #4
calefilm commentedI believe I was trying to add an FID token, i.e. [field_example_fid] to the "output this field as a link" option... but i guess it wasn't working. Don't know exactly how I was applying it but know I never figured it out. Something about drupal not being able to output the fid token -- I am no help at this point.
Comment #5
funex commentedThe only way I know around it is to output the view using a template and referencing the field directly there!
Comment #6
guysaban commentedusing views-customphp you can get the fid from the $data array.
Also, see http://daipratt.co.uk/drupal-getting-the-image-path-of-a-cck-field/
Comment #7
kirilius commentedThanks! I am trying this but I am lacking PHP knowledge here. Do you have a code sample? Also my images are in a multi-value imagefield. Does each of them represent a distinct views record?