I created a views from a CCK type. The CCK Type has a filefield, called field_hplbl_file. The views is displayed as a table. I'm using this file to theme the field output: views-view-field--file-list--field-hplbl-file-fid.tpl.php

The tpl.php file is being loaded properly, but I somehow can't access the variable $field. In my understand and what I see from views-view-field.tpl.php this should be the way to go.

When I access $row I get some values, but my file is not in there :( I guess I could use something like node_load($nid) and access the files, but this is not really clean and a waste of ressources.

In my understanding there must be some bug. Correct me if I'm wrong.

Comments

karens’s picture

Project: Views (for Drupal 7) » FileField
Version: 6.x-2.x-dev » 6.x-3.x-dev
Component: Views Data » Code

This is a filefield issue. Note that on the Filefield project page it plainly says filefield for D6 is still under development and not ready.

tyromind’s picture

Been trying to track this one down for a few days now.

I'm trying to use the value of the filefield in a views-view-field--....tpl.php file, and use it as the source for a mini media player, so each item in a list of audio files has a "play" button instead of a link to the file.

I guess this has been the source of my frustration! In the mean time I'll just either use strip_tags or parse the $output.

apersaud’s picture

In my views-view-field--....tpl.php file, I used this in order to get the file fid from my filefield cck field:

$fields['myfieldname_fid']->content;

dopry’s picture

Status: Active » Closed (fixed)

And from there you can use field_file_load... Or you could try making a proper formatter for you playlist..