0

I'm using D7.
I'd like to theme the separate page for editing profiles provided by Profile2 module(whose URL is MYWEBSITE.com/profile-MYPROFILE/[uid]/edit).
I searched and found the way that somebody has already suggested. And, by reference to that, I tried the way below. But it doesn't work. Can anybody tell me where I made a mistake?

Here is the way I tried but that didn't work...

1st: Create the customthem_theme() below into template.php file of customtheme theme.

function customtheme_theme() {    
    $items = array();
    $items['user_profile_form'] = array(
        'render element' => 'form',
        'path' => drupal_get_path('theme', 'customtheme') . '/templates',
        'template' => 'user-profile-form',
        'preprocess functions' => array(
             'customtheme_preprocess_user_profile_form'
        ),
    );
    return $items;
}

2nd: Create the template file user-profile-form.tpl.php and place it in the templates folder of custometheme.

3rd: Code the fields I want to display on user-profile-form.tpl.php
for ex

<html>
<?php

print drupal_render($form['form_build_id']);
print drupal_render($form['form_id']);
?>

<div>
         <?php  print render($form['profile_MYPROFILE']['field_MYFIELD']); ?>
</div>
</html>

I'm still very new to drupal and, honestly, don't figure out how its system works yet. I'm sorry if this is a very easy mistake to you. Thanks.

1 Answer 1

0

Change where it says customtheme to the actual theme name you are using.

for example if you are using bartik:

function bartik_theme() {
'path' => drupal_get_path('theme', 'bartik') . '/templates',
'preprocess functions' => array(
         'bartik_preprocess_user_profile_form'
    ),

The files should be located in your theme folder.

2
  • Thank you for answering, Akko. Actually, I tried the way you suggested on. I coded it after [return _zen_theme($existing, $type, $theme, $path);] within function_zen_theme(). But it didn't work. Do you know where I made mistake? Commented Oct 13, 2014 at 9:54
  • Can you show me the code of your comeplete theme function please? Then it's easier to see where you went wrong.
    – Akko
    Commented Oct 14, 2014 at 7:36

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.