I have used drupal built in form user_login and user_register_form, Is there a way to control label and textbox field separately, because in my markup each label and text field have different wrapping divs. For example, I have render a particular field like below:

<?php print render($form['name']); ?>

If I apply a wrapping div around this then it is applicable on both label and text field but I have separate divs with different class for each label and field. Is this possible?

1 Answer 1


If I understand you correctly, what you want to do is override the field template field.tpl.php.

To target specific fields you can rename your version of the file as per the template suggestion options for the field template.

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.