« Documentation for the DEIMS EML2Drupal module | Main | Print $node array at submission »

February 16, 2011

Notes on Views Custom Field (Drupal 6)

A few notes on Views Custom Field:

1) Enabling the module adds a new Field Type, "CustomField", to the Views configuration page.

2) Simple snippet used in the PHP field type:

print_r($data->node_data_field_app_fname_field_app_role_value); //print a value
print var_export($data, TRUE); // prints the data array
print_r($data); // prints the data array
dsm($data); // Requires devel, neater output

3) Weird behavior alert! The field names change when new fields are added. There are workarounds but so far a true solution is only found in the Drupal 7 version Views PHP.

Great module.

Bonus snippet:

echo $data->node_node_data_field_housing_inst_affil_title . " [nid:" . $data->node_node_data_field_housing_inst_affil_nid . "]" ;

Posted by kkwaiser at February 16, 2011 08:45 AM


Login to leave a comment. Create a new account.