According to the documentation, these are the available variables:
$items: An array of field values. Use render() to output them.
$label: The item label.
$label_hidden: Whether the label display is set to 'hidden'.
$classes: String of classes that can be used to style contextually through CSS. It can be manipulated through the variable $classes_array from preprocess functions. The default values can be one or more of the following:
field: The current template type, i.e., "theming hook".
field-name-[field_name]: The current field name. For example, if the field name is "field_description" it would result in "field-name-field-description".
field-type-[field_type]: The current field type. For example, if the field type is "text" it would result in "field-type-text".
field-label-[label_display]: The current label position. For example, if the label position is "above" it would result in "field-label-above".
However, I've attempted doing a print_r($items,1)
(and the others above) and it seems none of these are actually available to me within my views-view-field--field-download.tpl.php
where download
is the name of the field I am templating.
Notice: Undefined variable: items in include() (line 12 of /var/www/sites/path/to/templates/views/views-view-field--field-download.tpl.php).
What am I missing?
EDIT:
I also found this documentation, but am having a similar problem. It mentions I should have $fields, $view, and $row... but I am having trouble accessing some of these.
I am able to get some information I need using $row->_field_data["nid"]["entity"]->...
, but how do I output the field as it would normally be output? I have conditionals set up and want to output it as it would normally be on one condition, and output something else on another condition. I am able to get the data for the conditions to work properly... but can't figure out how to output the field as it would normally be.