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?

bumped to the homepage by Community 8 hours ago

This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

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 also issue at d.o and similar question at stackexchange.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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