How to render a DS fieldgroup programmatically in a node template? I am overriding a Display Suite view mode of a node using the template suggestion myLayout-node-myNode-full.tpl.php.

I am getting the $node->content using the node_build_content function. Then I have access and I am rendering all the node display fields using:

drupal_render($node-&gt;content['field_myField'])


But I cannot render fieldgroups using the drupal_render function, as it requires array parameter, but my fieldgroups are stdClass objects that can be accessed as:

$node-&gt;content['#groups']['group_myGroup']


Printing the $node variable, I do not get any other reference to fieldgroups, eg. $node->content['group_myGroup'] does not exist.

Any suggestions on how I could render fieldgroups in my template file in Drupal 7?
node_build_content is probably not suitable for your use case. However you should use node_view instead which calls node_build_content anyway but returns you the actual renderable array after it processes it and sends it through an alter as well.

For example:

function mytheme_preprocess_node(&amp;$vars) {
  if (!empty($vars['node'])) {
    $node = $vars['node'];

    if ($node-&gt;type == 'my_content_type') {
      $vars['content'] = node_view($node); //optionally supply view_mode as a second argument
    }
  }
}


Now you can just drupal_render($content) from your node template.