RDF module has hook_preprocess_image but module needs hook_preprocess_image_srcset

Created on 30 March 2015, over 9 years ago
Updated 19 September 2023, about 1 year ago

The RDF module adds the following hook -

/**
 * Implements MODULE_preprocess_HOOK().
 */
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'] = array('foaf:Image');
}

When I use the Schema.org module and the Picture module together, my source code for an image will contain the correct typeof="foaf:Image" for the <!--[if lt IE 9]> image tag. But, for the main image tag on the page used by IE9+ and modern browsers which is displayed in the <!--[if !lt IE 9]><!--> code, and is rendered with the theme_image_srcset() function, the rdf_preprocess_image() hook is obviously not run. I've added a custom MODULE_preprocess_image_srcset() function but ideally I think this function should exist in this module because RDF is core.

Feature request
Status

Closed: outdated

Version

2.0

Component

Code

Created by

🇬🇧United Kingdom DrupalGideon London

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024