Hello,
thank you for this wonderful module.
I have setup a Profile2 with Fieldgroups using multistep, and it works like a charme. I use it for guiding my users to compile their profile during their first login (like facebook's "First Steps").

What I would like to achieve, after the user has setup his profile, is to turn the fieldgroups from a multistep to a vertical-tab (or horizontal-tab) display.

How could I do this programmatically in a custom module, or template?

Thank you again!

Comments

nils.destoop’s picture

You can use the hook 'field_group_pre_render_alter to modify all the groups at once.
The element to render will be given as param, and #groups will be as key in the element.

In the #groups array, you can modify the format_type and format_settings from every group.

jeffschuler’s picture

jeffschuler’s picture

My form is normally set up with a group of vertical tabs. For anonymous users I want to change this to multipage.

My use of hook_field_group_pre_render_alter() is mostly working, but the resultant page shows all of the multipage panes laid out, one after another, and no previous/next buttons.

Any idea what I'm doing wrong here?

function mymodule_field_group_pre_render_alter(&$element, $group, &$form) {
  if ($form['uid']['#value'] == 0) {
    if ($element['#type'] == 'vertical_tabs') {
      $element['#type'] = 'multipage';
      $form['#groups'][$group->group_name]->format_type = 'multipage-group';
      field_group_pre_render_multipage_group($element, $group, $form);
    }
    if ($element['#type'] == 'fieldset') {
      $element['#type'] = 'multipage_pane';
      $form['#groups'][$group->group_name]->format_type = 'multipage';
      field_group_pre_render_multipage($element, $group, $form);
    }
  }
}
digitopo’s picture

I'm looking for the same functionality...

I'm using the Profile2 module for additional user fields. I have a profile2 profile type displayed during registration and have made it a multipage form using fieldgroup, but after registration, I would like it to all be on one page when users go back and edit this profile.

Can anyone provide some more info on how to achieve this? Thanks!

sime’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

As this issue is more than two years old, I'm closing this. Please do re-open if the functionality is still required or desired.