Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
nils.destoop CreditAttribution: nils.destoop commentedI 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 ?>
Comment #2
xqbzzr CreditAttribution: xqbzzr commentedOk, and how do I render a single field inside this field-group? In your example the postal field?
Comment #3
wluisi CreditAttribution: wluisi commentedYou'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.