Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
With #1282444: Support microdata for taxonomy_term, support was added for microdata output on Taxonomy Term Reference fields. However, the information such as the term description is currently not exposed in microdata because no microdata is output for the term on the term's page display.
Proposed resolution
Possibly add microdata_preprocess_taxonomy_term. RDF uses the following:
/**
* Implements MODULE_preprocess_HOOK().
*/
function rdf_preprocess_taxonomy_term(&$variables) {
// Adds the RDF type of the term and the term name in a <meta> tag.
$term = $variables['term'];
$term_label_meta = array(
'#tag' => 'meta',
'#attributes' => array(
'about' => url('taxonomy/term/' . $term->tid),
'typeof' => $term->rdf_mapping['rdftype'],
'property' => $term->rdf_mapping['name']['predicates'],
'content' => $term->name,
),
);
drupal_add_html_head($term_label_meta, 'rdf_term_label');
}
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedThis should be resolved before RC.