Views templates: How to print file fields I am creating a template for my table style view. I have several fields most of which are excluded from display. Inside my template I want to print those excluded from display fields. After some search I found that you can access all fields including those excluded by using:

$view-&gt;result[$row_count]-&gt;


Now the field I want to print is a file. This is the structure that dpm returns me:


  field_field_programme (Array, 1 element)


0 (Array, 2 elements)
    rendered (Array, 3 elements)
        #theme (String, 9 characters ) file_link
        #file (Object) stdClass
            fid (String, 4 characters ) 1011
            display (String, 1 characters ) 1
            description (String, 0 characters )
            uid (String, 1 characters ) 1
            filename (String, 10 characters ) seminar3.pdf
            uri (String, 40 characters ) public://seminaria/programmes/seminar3.pdf
            filemime (String, 15 characters ) application/pdf
            filesize (String, 6 characters ) 218882
            status (String, 1 characters ) 1
            timestamp (String, 10 characters ) 1333973478
            rdf_mapping (Array, 0 elements)
        #access (Boolean) TRUE
    raw (Array, 11 elements)
        fid (String, 4 characters ) 1011
        display (String, 1 characters ) 1
        description (String, 0 characters )
        uid (String, 1 characters ) 1
        filename (String, 10 characters ) seminar3.pdf
        uri (String, 40 characters ) public://seminaria/programmes/seminar3.pdf
        filemime (String, 15 characters ) application/pdf
        filesize (String, 6 characters ) 218882
        status (String, 1 characters ) 1
        timestamp (String, 10 characters ) 1333973478
        rdf_mapping (Array, 0 elements)


It is not as simple as using $field->content. How can I print my file? Do I need to create a link and add the information above? What code can I use so depending on the filemime the icon will change?

In other views I have created the output of files is:

&lt;a type="xxx; length=xxx" href="xxx"&gt;&lt;img src="/modules/file/icons/xxx" title="xxx" alt="" class="file-icon"&gt;&lt;/a&gt;


With the information I get from the file I could create such a link. I am guessing length is the filesize? Maybe there is an api function that constructs file links?
Using  this seems to do exactly what I want

&lt;?php print $view-&gt;style_plugin-&gt;rendered_fields[$row_count]['field_programme']; ?&gt;


which is extremely useful since it can be used even for fields that have been excluded from the display of the view.