In Drupal 6, I’m using the Views Custom Field module to insert some php into my View. The helper text in the php CustomField reads:
$data: contains the retrieved record from the database (e.g. $data->nid).
Okay… seems pretty straightforward. So, I have a custom field named field_short_title that’s being output in the view. Now how do I pull that value out of the $data variable? I’ve tried the following, but no luck:
$data->field_short_title
$data->field_short_title_value
$data->node_data_field_short_title.field_short_title_value
Surely this is just some kind of Drupal syntax error on my part… right?
Ahh… I used
<?php print_r ($data) ?>to see what’s going on with that $data variable. Here’s what I was looking for:So the whole thing looks like this:
Intuitive, isn’t it? Sigh…