Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function MYMODULENAME_form_alter(&$form, &$form_state, $form_id) {
- if($form_id == 'page_node_form') {
- //Adds a class to 'my image' field in the node edit form of content-type page.
- //print_r($form);
- $form['field_my_image']['#prefix']=''; //div class="myclass_name"
- $form['field_my_image']['#suffix']='';//Close div here
- //OR
- $form['field_my_image']['#attributes']['class'][]='myclass_name';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement