I have added custom date, text and checkbox fields to the event content type and 'm in the early stages of learning how to manipulate these values in the template. I can query the $node object for all the fields in the node and I correctly get back all the intrinsic as well as custom field names. When I query the values, though, all I get are 'Array' types for the custom fields. Looping through these arrays produces no results that are of use to me. Here's an example of the code I embedded in event.tpl.php:
<?php
foreach($node as $key => $value) {
print $key.": ".$value."<br />\n";
if (is_array($value) && (substr($key,0,6) == "field_")) {
print "array size:".count($value)."<br />\n";
foreach($value as $arr_key => $arr_val){
print " ".$arr_key.": ".$arr_value."<br />\n";
}
}
}
?>
Any help/elucidation or further pointers are greatly appreciated. If this query is incorrectly posted in this forum, kindly let me know where best to have new drupal user queries researched.
Comments
one more thing... (CCK)
the custom fields are CCK fields and I'm using cck-5.x-1.5 on Drupal 5.1. Is there a CCK API I need to be aware of to extract CCK field data when designing my template?