You are here

function microdata_hook_field_info in Microdata 7

Enable microdata for a field type.

This is a placeholder for describing further keys for hook_field_info(), which are introduced by Microdata module. It also documents Entity API keys which are required for Microdata.

If a field has a simple value (string, number, etc) or if it is an item value (entities, addressfields), enable microdata on the field itself. Some fields, such as Link, are just containers for properties (ie, the link url and the linked text). These have a struct data type and microdata output should not be enabled for the field, but on the properties themselves.

See also

entity_hook_field_info()

File

./microdata.api.php, line 28
Hooks provided by Microdata module.

Code

function microdata_hook_field_info() {
  return array(
    'addressfield' => array(
      'label' => t('Postal address'),
      // property_type and property_callbacks come from Entity API.
      'property_type' => 'addressfield',
      'property_callbacks' => array(
        'addressfield_property_info_callback',
      ),
      // ...
      // Enable microdata for this field.
      'microdata' => TRUE,
    ),
  );
}