I'm stumped.

I'd like to insert a CCK address field into a node template using the module's formatter rather than inserting each address field separately.

I'm pretty sure I want to be calling cck_address_field function, but have no idea how to retrieve the field's subfields for the "item" parameter (the array of address fields).

This use of multiple fields looks like it is being handled somewhere in the CCK system, but I don't know how to use it from within a node.tpl

So if I know the name of the address CCK field, how do I insert it into a node template?

Thanks,

-P

Comments

ptone’s picture

Status: Active » Closed (fixed)

Using this snippet from another thread:

 <?php
drupal_set_message("<pre>T1:" . print_r($node->field_business_address, TRUE) . '</pre>');
drupal_set_message("<pre>T2:" . print_r($node->field_business_address[0], TRUE) . '</pre>');
drupal_set_message("<pre>T3:[" . print_r($node->field_business_address[0]['value'], TRUE) . ']</pre>');
 ?>

I was able to see that there was already the "view" item being stored in the field.

-P