Is there a way to theme the user/edit page? I would like to display only a few fields, such as emailadress, password and userpicture and hide al the other ones...

Comments

vm’s picture

theme developers section of the documention would have provided : Using different page templates depending on the current path

_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

kloewer@drupal.org’s picture

Thnx, that worked if i would like to theme the user/edit page as a whole.

Butt still print($content) lists all data added by several modules, like guestbook settings, localisatin language chooser, privatemsg emailsettinggs, etc...

What if i only want to list: username, password change form, emailadress change form and pictureuploadform?

Found something in http://api.drupal.org/api/function/user_edit_form/5, but can not realy deal with this...

vm’s picture

use http://api.drupal.org/api/function/hook_form_alter/5

or maybe investigate the contemplate.module which may help you sort through the varaibles and which fields to add or omit in your custom.tpl.php file if you don't want to use the hook_form_alter function to override fields.

_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

kloewer@drupal.org’s picture

I allready using the contemplate, to alter the appearance of some nodes and contentypes.

But i dont see how i can alter the look of the "Edit Account"page in drupal, because there is no contenttype for that ( at least i can't find anyone...)

Do you understand my problems? i have a pretty neat lookin user profile using nodeprofile, usernode and some other modules rgarding to the tutorial on shellmultimedia, and when the user edit his preferences, like hobies, name, stats, contact details - everything is okay, but this little menuitem where he can edit gis account settings, like emailadress and upload a profilepicture, is still this ugly drupal layout with all the stuff other modules providet in it...

i realy would apreciate some tips, hints, or keywords for what i have to search on google, to get this thing done. my intensions where do disable the acces to user/X/edit, but how can users then change their profilepicture and their emailadress?

THNX
ad lots of
LUV

vm’s picture

http://www.hiveminds.co.uk/node/3109
http://drupaldojo.com/minilesson/hook-form-alter-breakdown
http://groups.drupal.org/node/4308

all of the above relate to:
http://api.drupal.org/api/function/hook_form_alter/5

_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

kloewer@drupal.org’s picture

Thnx for the links!

Meanwhile i found out that you can display der user edit form on every page by using:


 print drupal_get_form('user_edit');

Using


 print drupal_get_form('user_edit_form');

prints only USERNAME, EMAIL_EDIT_FORM, and PICTURE_UPLOAD_FORM, but without data, form and tokens, so i have to work on that again...

With


function MYTHEME_user_edit($form) {
  
  $output .= drupal_render($form);
  
  foreach ($form as $key => $element) {
    $output .= '<div id="user-'. $key. '">';
    $output .= drupal_render($element);
    $output .= '</div>';
  }
  
  return $output;
}

i managed to wrap every form element in a named CSS Element, so i was able to hide them with

 // NO PHP CODE, JUST FOR FORMATING REASONS. CODE BELOW IS CSS

#DIV-ELEMENT {

display: none;

}

and with

 // NO PHP CODE, JUST FOR FORMATING REASONS. CODE BELOW IS CSS

#DIV-ELEMENT {

display: block;

}

i was able to enable them one by one again...

kloewer@drupal.org’s picture

Unfortunateli i get some error messages, because some of the code should be in an array


    * warning: uasort() [function.uasort]: The argument should be an array in /Users/drupal/includes/common.inc on line 2140.
    * warning: uasort() [function.uasort]: The argument should be an array in /Users/drupal/includes/common.inc on line 2140.
    * warning: uasort() [function.uasort]: The argument should be an array in /Users/drupal/includes/common.inc on line 2140.
    * warning: uasort() [function.uasort]: The argument should be an array in /Users/drupal/includes/common.inc on line 2140.
    * warning: uasort() [function.uasort]: The argument should be an array in /Users/drupal/includes/common.inc on line 2140.
    * warning: Cannot use a scalar value as an array in /Users/drupal/includes/common.inc on line 2171.
    * warning: Cannot use a scalar value as an array in /Users/drupal/includes/common.inc on line 2182.
    * warning: uasort() [function.uasort]: The argument should be an array in /Users/drupal/includes/common.inc on line 2140.

dont know how to deal with this, so i hided the errormessages on my user/edit pages with

  //NO PHP CODE; JUST FOR FORMATING REASONS. CODE BELOW IS CSS


#message{

display: none;

}



Not the best solution, but works for me by now. Need to be fixed someday...

Glowingtree’s picture

what format would the tpl file-name come in?

would page-user-edit.tpl.php work for all user/edit pages?

Glowingtree’s picture

I made a page-user-edit.tpl.php , just to add a class to css ID #content - now
I can manipulate all the "fieldset", "label" classes etc.. with contextual selection
for basic over-all style changes to edit pages, trying to strip down to a basic list
of options, not an encyclopedia in length! - not what this post was about initially, but
as an aside, good to know this can be done in re: user pages