1

How to customize the profile edit form of the Profile2 module using a template?

Profile2 has the main profile (admin/structure/profiles/manage/main), and it is set to provide a separate page for editing profiles (profile-main/1/edit).

In Drupal 7, for a content type such as faq, I can use a template to customized its edit form.

In template.php, I am using the following code:

function MYTHEME_theme(&$existing, $type, $theme, $path) {
  return array(
      'faq_node_form' => array(
      'arguments' => array('form' => NULL),
      'template' => 'node--faq--edit',
      'render element' => 'form',
  ),
  );
}

I then create node--faq--edit.tpl.php, where I can customize it.

What is the equivalent method I could use for a Profile2 profile edit form?

1 Answer 1

0

You should use form_id as theme key in hook_theme(), which is user_profile_form in the case.

function MYTHEME_theme(&$existing, $type, $theme, $path) {
  return array(
    'user_profile_form' => array(
      // …
    ),
  );
}

See Theme Profile2 Form, a support request opened for the Profile2 module.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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