diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 0edb028..669a66a 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1843,7 +1843,9 @@ function theme_dropbutton_wrapper($variables) { } /** - * Returns HTML for an image. + * Prepares variables for an image. + * + * Default template: image.html.twig. * * @param $variables * An associative array containing: @@ -1865,7 +1867,7 @@ function theme_dropbutton_wrapper($variables) { * popular browsers. * - attributes: Associative array of attributes to be placed in the img tag. */ -function theme_image($variables) { +function template_preprocess_image(&$variables) { $attributes = $variables['attributes']; $attributes['src'] = file_create_url($variables['uri']); @@ -1875,7 +1877,7 @@ function theme_image($variables) { } } - return ''; + $variables['attributes'] = new Attribute($attributes); } /** @@ -3165,6 +3167,7 @@ function drupal_common_theme() { // The title attribute is optional in all cases, so it is omitted by // default. 'variables' => array('uri' => NULL, 'width' => NULL, 'height' => NULL, 'alt' => '', 'title' => NULL, 'attributes' => array()), + 'template' => 'image', ), 'breadcrumb' => array( 'variables' => array('breadcrumb' => NULL), diff --git a/core/modules/system/templates/image.html.twig b/core/modules/system/templates/image.html.twig new file mode 100644 index 0000000..d3234da --- /dev/null +++ b/core/modules/system/templates/image.html.twig @@ -0,0 +1,15 @@ +{# +/** + * @file + * Default theme implementation an image. + * + * Available variables: + * - attributes: Associative array of attributes to be placed in the img tag. + * + * @see template_preprocess() + * @see template_preprcoess_image() + * + * @ingroup themable + */ +#} +