Theme a Views Table
Very useful thread, great helpful people responding to it:
How to theme view module's "table view"?
http://drupal.org/node/87367
Thanks to a tip from
<?php
/**
* Function to handle a sample field.
*/
function phptemplate_views_handle_field_participants_users_name($fields, $field, $data) {
$info = $fields[$field['fullname']];
if ($field['handler'] && function_exists($field['handler'])) {
return $field['handler']($info, $field, $data->$field['queryname'], $data);
}
if ($info['handler'] && is_string($info['handler']) && function_exists($info['handler'])) {
return $info['handler']($info, $field, $data->$field['queryname'], $data);
}
return check_plain($data->$field['queryname']);
}
?>
Fields can be precisely overrided with functions named like this (and modeled on the above), where "participants" is the name of the view:
Node: Author Name
phptemplate_views_handle_field_participants_users_name
Taxonomy: Terms for Places (vocabulary number 5)
phptemplate_views_handle_field_participants_term_node_5_name
Node: Body
phptemplate_views_handle_field_participants_node_body
@TODO ben-agaric: Get a CCK field example.
Comments
Post new comment