I'm overriding a field template for one of my views and I want to be able to access another field value from the $row variable. The documentation on the template file shows this:
When fetching output from the $row, this construct should be used: $data = $row->{$field->field_alias}
My field is called field_calendar_title, but the following doesn't work as expected:
$row->{$field->field_calendar_title}
I get the following error:
Fatal error: Cannot access empty property...
Is the field "alias" different from the name of the field in the content type?
"Cleansed" output from var_dump of $row:
stdClass Object
(
[node_title] => ...
[nid] => 568
[field_data_field_performance_date_delta] => 0
[field_data_field_performance_date_language] => und
[field_data_field_performance_date_bundle] => event
[field_data_field_performance_date_field_performance_date_val] => 2012-03-02 19:00:00
[field_data_field_performance_date_node_entity_type] => node
[_field_data] => Array
(
[nid] => Array
(
[entity_type] => node
[entity] => stdClass Object
(
[vid] => 878
[uid] => 0
[title] => ...
[log] =>
[status] => 1
[comment] => 0
[promote] => 0
[sticky] => 0
[nid] => 568
[type] => event
[language] => und
[created] => 1329332968
[changed] => 1331836509
[tnid] => 0
[translate] => 0
[revision_timestamp] => 1331836509
[revision_uid] => 1
[body] => Array
(
[und] => Array
(
[0] => Array
(
[value] => ...
[summary] => ...
[safe_summary] => ...
)
)
)
[field_resident_company] => Array ( [und] => Array ( [0] => Array ( [tid] => 3 ) ) )
[field_series] => Array ( [und] => Array ( [0] => Array ( [tid] => 36 ) ) )
[field_venue] => Array ( )
[field_rotator_image] => Array ( )
[field_exclude] => Array ( [und] => Array ( [0] => Array ( [value] => 0 ) ) )
[field_performance_image] => Array ( )
[field_premiere] => Array ( [und] => Array ( [0] => Array ( [value] => 1330714800 [timezone] => UTC [timezone_db] => UTC [date_type] => datestamp ) ) )
[field_closing] => Array ( [und] => Array ( [0] => Array ( [value] => 1330714800 [timezone] => UTC [timezone_db] => UTC [date_type] => datestamp ) ) )
[field_exclude_update] => Array ( [und] => Array ( [0] => Array ( [value] => 0 ) ) )
[field_performance_date] => Array ( [und] => Array ( [0] => Array ( [value] => 2012-03-02 19:00:00 [timezone] => UTC [timezone_db] => UTC [date_type] => datetime ) ) )
[field_performance_id] => Array ( [und] => Array ( [0] => Array ( [value] => 1436 [format] => [safe_value] => 1436 ) ) ) [field_event_status] => Array ( [und] => Array ( [0] => Array ( [value] => open ) ) )
[field_calendar_title] => Array ( [und] => Array ( [0] => Array ( [value] => PSYCHIC EXP [format] => [safe_value] => PSYCHIC EXP ) ) )
...
)
)