I'm using Renderable elements with Display Suite Forms to handle the display of node add/edit forms.

I would like to add a form field to my node edit form via hook_form_alter(). I don't want to create this field on the node.

Display Suite works well to show custom fields but only on the display of the node, not on the edit form.

I have added some fields to my node edit form, but they appear at the bottom. I have tried adding the field to $form['#groups']['my_field_group_name']['children'][] = 'my_custom_field_name' but that doesn't seem to work.

Do you have any advice on how to properly place these forms where I'd like them? Thanks.

Comments

dtarc’s picture

If fields are registered with hook_field_extra_fields, they will be available on the Manage Fields page of the content type.

hook_field_extra_fields() - registers the fields so that they are available
hook_form_alter - adds the fields to the form in question