Hi,

Has somebody know how to apply a theme in edit/user in drupal 6? The files user-profile*.tpl.php just has applied to view user profile, not in edit user profile.

Thanks,

Bruno

Comments

raffi’s picture

In your theme directory create the following files

page-user-edit.tpl.php for user edit page
page-user.tpl.php for profile page.

I hope this solves your problem

brunolovato’s picture

I did that, but in this case I already have the "html" form edit build. All fields are already in the variable $content. Other bad issues, that if you create categories in User Profile, it cames separet in user edit form, and not in one screen.

In fact, I following the same idea from view profile.
In view profile , drupal gives this files

user-profile-category.tpl.php
user-profile-item.tpl.php

to theme the fields the way that I want.
But, there isn't a file for edit. This didn't has been applyed for edit user.
That is the question, why drupal don't provide a file template to customize the fields before it goes to $content variable?
I believe this is a fault.

Bruno Lovato

brunolovato’s picture

I believe also that that should have a way to intercept the function in template.php, but I don't have any idea how to do that.
If somebody know that, I appreciate some comments... :-)

diman1984.10’s picture

Try this
function themename_theme() {
return array(
'user_profile_form' => array(
'template' => 'user-profile-form',
'arguments' => array('form' => NULL),
),
// other theme registration code...
);
}
In theme create file user-profile-form.tpl.php

aliyayasir’s picture

Try this
function themename_theme() {
return array(
'XXX_node_form' => array(
'template' => 'user-profile-form',
'arguments' => array('form' => NULL),
),);
}

where XXX = your profile content type name

Aliya Yasir
Co-founder & CTO
YAS Global Inc.
Email: aliya@yasglobal.com
Web: www.yasglobal.com

manu.joseph’s picture

Hey diman1984.10....Workz for me.. I was searching for this for so many dayz..Thank God...I got it...am a newbie...

ardnet’s picture

Hi all, how about for Drupal 7? I have tried that one above but it doesn't work.
Thanks

ardnet’s picture

Ah, finally I figured this out.
In your template.php or custom module, put it like this:

<?php
/**
 * Implementation of hook_theme().
 */
function custmod_theme(){
  return array(
    'user_profile_form' => array(
      'render element' => 'form',
      'template' => 'user-profile-form',
    ),
  );
}
?>

Make the template file call user-profile-form.tpl.php, then put the code like this:

<?php print drupal_render_children($form); ?>

Enjoy ;)
Cheers