Form API

The definitive Drupal "Field API Option List vs. Taxonomy" pro & con list

Here I am building out a content type for a new project again. I've got to decide whether to use a Option List field or a Taxonomy field. It's an easy choice right? Right? Once you think far enough down a site roadmap, you'll discover it rarely becomes a simple answer. I've read many articles on the subject and nothing I've found seems to cover all details. That being said, if you find any details or related links I've missed be sure to let me know in the comments.

Making a custom block with an admin settings form in a Drupal module

Often while building a Drupal website, you'll need to create a custom Block containing HTML and content. Completely standard right? It's a problem when your client or the site maintainer needs to change some of that content. They are forced to wade through significant amounts of HTML to find that little bit of content to update. Instead, why don't you build a custom settings page? Your site maintainer gets a simple form to update and you get variables to output.

Get the renderable array for a single field instance

I'm building an interface to simplify the user experience during content creation. Users select options in three <select> fields, then on submit, they are forwarded to the correct content type add node form for the options selected. Some of the values from the original form will be be pre-filled in the new node add form.
To create this new form, I need fields from the content types and user profile. Given a content type, field name, and field instance, this is the code you need to get the Form API renderable array for the field.

Subscribe to Form API