I have my CCK fields in groups. The default CCK display puts these all together nicely. I want to use Contemplate because of other parts of the node, but it breaks my groups into individual fields. I tried playing with a nested foreach to walk through the group but my PHP isn't up to the task. Could someone tell me what code I need to put in there to print out an entire group at a time, please?

Thanks,

Michelle

Comments

michelle’s picture

Title: Printing a group at a time » [Solved] Printing a whole group at a time in contemplate
Status: Active » Fixed

With some help from people on IRC, I got this working. Here's the code:

      if (is_array($node->content['group_stats'])) {
        foreach ($node->content['group_stats'] as $key => $value) {
           if (is_array($value)) {
             if (array_key_exists('#value', $value)) {
               print $value['#value'] ;
             }
           }
        }
      }
      

Note: Change "group_stats" to whatever your group is.

Michelle

Anonymous’s picture

Status: Fixed » Closed (fixed)