diff --git a/templates/paragraphs/paragraph--uw-para-marketing-block.html.twig b/templates/paragraphs/paragraph--uw-para-marketing-block.html.twig index 2952a5429bdc7559720327be0facad600f7df706..73d768226ddf65e7c907b33d9d1e2fb999d83be1 100644 --- a/templates/paragraphs/paragraph--uw-para-marketing-block.html.twig +++ b/templates/paragraphs/paragraph--uw-para-marketing-block.html.twig @@ -15,6 +15,10 @@ * or print a subset such as {{ content.field_example }}. Use * {{ content|without('field_example') }} to temporarily suppress the printing * 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. * The attributes.class element may contain one or more of the following * classes: @@ -43,5 +47,6 @@ "sources": sources, "marketing_text": content.field_uw_marketing_text|field_value.0['#text'], "output_image_tag": output_image_tag, - "img_element": img_element + "img_element": img_element['#uri'], + "alt": alt } %} diff --git a/uw_fdsu_theme_resp.theme b/uw_fdsu_theme_resp.theme index 62acde741be91f6eb6a83798ca328a154fd58b07..62b4c2812fcb4829681e509249d9fc660cc29add 100644 --- a/uw_fdsu_theme_resp.theme +++ b/uw_fdsu_theme_resp.theme @@ -60,6 +60,9 @@ function _uw_fdsu_theme_resp_add_responsive_image_variables(&$variables, $field_ // Get the field entity from the paragraph. $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. $file = $field->entity;