I want to print only bits of a very big form, my first approach was as follow:
function THEME_preprocess_user_profile(&$variables) {
global $user;
$account = user_load($user ->uid);
$variables['user_edit'] = drupal_get_form('user_profile_form', $account);
$variables['user_edit']['field_about_me'] = 'invisible';
.....
$variables['user_edit']['field_some_filed'] = 'invisible';
}
This does work to hide certain element, the problem is that there is way more elements i want to hide than elements i want to show, so this process can be tedious..
Would anyone think of a better way to do so ?
UPDATE : Ideally i'd like to have a function similar to drupal_get_form, but that instead only return a targeted element.
Thanks a lot