Provides super themer-friendly template variables for entity fields.

This module takes the mystery out of theming fieldable entities. For each field in an entity, it extracts the values that you actually want to output (from the infamous "massive nested arrays" that Drupal provides), and it puts those values in dead-simple variables.

The module supports all of the Drupal 7 core fieldable entities (nodes, users, and taxonomy terms). Plus, it supports all of the Drupal 7 core field types (the text types, the list types, the number types, file, image, term reference), as well as several of the more popular contrib field types (link, email, date, node reference).

This is a utility module for themers. Its only purpose is to make Drupal template development less painful. It has no front-end. It stores no data. It implements no hooks. In order for it to do anything, some coding is required, but only coding in your theme files.

The variables are not provided to any of your templates automatically. You can add them by calling tpl_field_vars_preprocess() from your preprocess functions in template.php (automatically populates the preprocess function's variables array, which is passed by reference), or by calling tpl_field_vars() from anywhere else (returns the generated variables as an array).

Also included is some simple debugging functionality, which lets you know what variables are being generated; and some cleanup functionality, which removes Drupal's default field arrays from your preprocess variables.

Project information

Downloads