Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Hide format text from body in drupal

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 336
    Comment on it

    If anyone wants to hide the format text from the body field in drupal then try it:-

    // override hook_form_alter
        function CUSTOM_MODULENAME_form_alter(&$form, &$form_state, $form_id)    {
            if($form_id == 'restaurants_node_form') {//form_id
                 //do modification to form array $form
                 $form['#after_build'][] = 'CUSTOM_MODULENAME_NODETYPE_node_form_after_build';
              }
        }
    
    // function to unset form values
        function CUSTOM_MODULENAME_NODETYPE_node_form_after_build($form){
            $form['body']['und']['0']['format']['#access'] = FALSE;
            return $form;
        }   
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: