function rdf_preprocess_image

Same name in other branches
  1. 7.x modules/rdf/rdf.module \rdf_preprocess_image()
  2. 9 core/modules/rdf/rdf.module \rdf_preprocess_image()

Implements hook_preprocess_HOOK() for image.html.twig.

File

core/modules/rdf/rdf.module, line 591

Code

function rdf_preprocess_image(&$variables) {
    // Adds the RDF type for image.  We cannot use the usual entity-based mapping
    // to get 'foaf:Image' because image does not have its own entity type or
    // bundle.
    $variables['attributes']['typeof'] = [
        'foaf:Image',
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.