You are here

function hook_microdata_suggestions in Microdata 7

Suggest microdata terms to use for a field type and its properties.

This hook should only be used by the module that defines the field type. Other modules can use hook_microdata_suggestions_alter() to add or change suggested mappings for a field.

Return value

array An array of suggested mappings, keyed as following: $suggested_mappings[group][field_name][mapping scheme]

See also

hook_microdata_suggestions_alter()

1 invocation of hook_microdata_suggestions()
microdata_form_field_ui_field_edit_form_alter in includes/microdata.form_alter.inc
Implements hook_form_FORM_ID_alter().

File

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

Code

function hook_microdata_suggestions() {
  $suggestions = array();

  // Suggested Schema.org mapping for the Fivestar field.
  $suggestions['fields']['fivestar']['schema.org'] = array(
    '#itemprop' => array(
      'aggregateRating',
    ),
    '#itemtype' => array(
      'http://schema.org/AggregateRating',
    ),
    'average_rating' => array(
      '#itemprop' => array(
        'ratingValue',
      ),
    ),
  );
  return $suggestions;
}