My issue is that using the field_group module will create field groups for the form and the node view. And I don't want to group fields for viewing, I just want to make the form neater.

Here's a failed attempt (seems to ignore the values from body and title fields): https://gist.github.com/9651054

  • 1
    That code is only altering the form, it would not alter the display. You must have something else altering the display, maybe you changed it in the 'Manage Display' UI? – leexonline Mar 19 '14 at 21:17
  • @leexonline I just want to change the form. I want the display to stay the same. – Capi Etheriel Mar 19 '14 at 21:19
  • 1
    Yes and what I was saying is that form_alter only alters the form, it cannot alter the display. I don't know how it's possible you grouped fields on display using this code. – leexonline Mar 19 '14 at 21:25
  • Oh, no, my code doesn't group fields. It's the field_group module that does it. And I'm avoiding it :) – Capi Etheriel Mar 19 '14 at 21:38
  • You are very confused I think. Your code certainly groups fields into the container 'formgrouper'. Your opening statement about field_group creating groups for the form and view is true except that you don't have to create groups on both, you can create them just for the form or just for the display. You can definitely use field_group and it's a great module. – leexonline Mar 19 '14 at 21:52

Found it. Turns out the array keys are very important. The first time around, I added the form fields to the fieldset without any keys. It started working just by adding the proper array keys to the fieldset, see the last revision.

Not the answer you're looking for? Browse other questions tagged or ask your own question.