I'm trying to theme my registration page using this tutorial http://www.crimsonlizard.co.uk/blog/theming-registration-form-drupal-7. It only works if I disable the field group module. I tried many similar tutorials and they didn't work until I discovered field group module was preventing the fields from displaying.

Comments

nils.destoop’s picture

Status: Active » Closed (cannot reproduce)

I followed the steps from that blog post. But my form renders correctly.

Little note: if you put fields in the fieldgroup, you have to render the fieldgroup, not the field.

Example

i have following setup:
- group
- postal field
- firstname field

then you have to render that group like this:
<?php print drupal_render($form['group_mygroup']); // prints the fieldgroup and it's children ?>

xqbzzr’s picture

Ok, and how do I render a single field inside this field-group? In your example the postal field?

wluisi’s picture

You've probably already figured this out, but came across this issue on a Google search for a related issue. To answer your question, here's some example code:

print drupal_render($form['group_student']['group_bio']['body']);

This content type's 'Body' field is actually inside 2 groups: 'group_student', which is a 'horizontal tabs group' and ' group_bio', which is a 'horizontal tab item'. There can be other types of groupings, obviously, but the 'item' inside 'group' nesting would be simliar if you were using Vertical or Accordion.

All depth levels of the groupings needs to be included in the drupal_render.