2

On the user profile edit page I can do something like this in my theme's template.php file to hide a field:

function MYTHEME_form_user_profile_form_alter(&$form,$form_state,$form_id){
//remove unwanted fields from the form (default value is still saved)
  $form['timezone']['#access'] = FALSE;
}

On the profile view page, I am trying to do a similar thing. I want to hide:

History
Member for 3 months 4 weeks

So I looked up the api function and it's hook_user_view

Based on this I try:

function MYTHEME_user_view($items) {
$items['member_for']['#access'] = FALSE;
}

... however, this does not work after I clear the cache. I'd also like to avoid hiding this using CSS display:none.

5

You do not need to use any preprocess functions tbh :> its pretty simple Go to Home » Administration » Configuration » People » Account settings » Manage Display , History -> Format chose hidden.

1
  • Perfect, thanks! I actually have never used that page before, never had a need to until now. :) – Danny Englander Dec 28 '12 at 0:12

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.