Skip to content
Snippets Groups Projects
Commit 793caf3a authored by Eric Bremner's avatar Eric Bremner
Browse files

ISTWCMS-2443: Updating preprocess for alt value and sending alt value in template

parent d0fedfeb
No related branches found
No related tags found
No related merge requests found
...@@ -15,6 +15,10 @@ ...@@ -15,6 +15,10 @@
* or print a subset such as {{ content.field_example }}. Use * or print a subset such as {{ content.field_example }}. Use
* {{ content|without('field_example') }} to temporarily suppress the printing * {{ content|without('field_example') }} to temporarily suppress the printing
* of a given child element. * of a given child element.
* - sources: The attributes of the <source> tags for this <picture> tag.
* - img_element: The controlling image, with the fallback image in srcset.
* - output_image_tag: Whether or not to output an <img> tag instead of a
* <picture> tag.
* - attributes: HTML attributes for the containing element. * - attributes: HTML attributes for the containing element.
* The attributes.class element may contain one or more of the following * The attributes.class element may contain one or more of the following
* classes: * classes:
...@@ -43,5 +47,6 @@ ...@@ -43,5 +47,6 @@
"sources": sources, "sources": sources,
"marketing_text": content.field_uw_marketing_text|field_value.0['#text'], "marketing_text": content.field_uw_marketing_text|field_value.0['#text'],
"output_image_tag": output_image_tag, "output_image_tag": output_image_tag,
"img_element": img_element "img_element": img_element['#uri'],
"alt": alt
} %} } %}
...@@ -60,6 +60,9 @@ function _uw_fdsu_theme_resp_add_responsive_image_variables(&$variables, $field_ ...@@ -60,6 +60,9 @@ function _uw_fdsu_theme_resp_add_responsive_image_variables(&$variables, $field_
// Get the field entity from the paragraph. // Get the field entity from the paragraph.
$field = $variables['paragraph']->get($field_name)->first(); $field = $variables['paragraph']->get($field_name)->first();
// Set the alt tag from the field entity.
$variables['alt'] = $field->get('alt')->getValue();
// Set the file entity based on the field name. // Set the file entity based on the field name.
$file = $field->entity; $file = $field->entity;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment