2

I have user relationship installed. When i enable the user relationship node access module, the "Share content" field set appears on my user profile.

Is there a way to hide, remove or change the weight of the field set as I do not like the position it occupies on my user profile?

Thank you.

user profile

2 Answers 2

2

You can hide, change weight of any form element by help of form_alter().

You will have to create a small module for it with any name like - myModule.

Put .info file in there & a .module file. Declare the information of the module. Enable the module.

Use my given hook & see what is available in form by DPM(You will need devel module to use this).

Write some thing like this

function myModule_form_alter(&$form, &$form_state, $form_id){
  dpm($form);
}

When you will visit the form you will get output of $form variable, where you can find $form_id to use to put in condition & the element which you are looking to remove or change properties.

Then you will have to put your logic in the function to have this working according to your need. Like see, how you can remove description from name/password field at login form --

function myModule_form_alter(&$form, &$form_state, $form_id){
  if($form['#id'] == 'user-login'){
    $form['name']['#description'] = t('');
    $form['pass']['#description'] = t('');
  }
}

This is not the exact solution you are looking for, but this is the way you can do it from yourself. I hope this help..

0

To add up to RajeevK's answer, you can always of course hide or change the appearance of form elements using CSS in your theme. Be careful that hiding form elements with CSS means that a user could still post data in the hidden elements if he would so wish to, so plan accordingly.

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.