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->result[$row_count]->
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:
<a type="xxx; length=xxx" href="xxx"><img src="/modules/file/icons/xxx" title="xxx" alt="" class="file-icon"></a>
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?