coder1.com

  • home
  • drupal articles
  • contact
Home

Fieldsets

Adding IDs to all Fieldsets

Mike Milano — February 5, 2010 - 11:42am

A themer on a project I was recently working on needed a lot of CSS IDs added to fieldsets throughout the site.

Fortunately, there's a theme_fieldset() function in includes/forms.inc

I was able to copy that function into the phptemplate.php file, obviously change theme_ to phptempalte_ in the function name, and then add logic that adds an ID based on the fieldset name if an id does not already exist.

Here's the code:

  1. /**
  2.  * Format a group of form items.
  3.  *
  4.  * @param $element
  5.  * An associative array containing the properties of the element.

  • Drupal
  • Fieldsets
  • 1 comment
  • Read more
Syndicate content

Poll

Have you checked out Drupal 7 yet? (still alpha):

User login

  • Request new password

Navigation

  • Recent posts
  • home
  • drupal articles
  • contact