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

calefilm’s picture

I 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?

kirilius’s picture

I am trying to do the same but can't find a working solution. Any help from the developer is very welcome.

funex’s picture

me too. Can't seem to work it out. Is it a bug in views?

calefilm’s picture

I 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.

funex’s picture

The only way I know around it is to output the view using a template and referencing the field directly there!

guysaban’s picture

using 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/

kirilius’s picture

Thanks! 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?