Skip to content

Commit

Permalink
include alt_tag in listing templates as well
Browse files Browse the repository at this point in the history
  • Loading branch information
jackahl committed Oct 1, 2024
1 parent cb58563 commit 0a3fb93
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion plone/app/contenttypes/browser/templates/listing.pt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
item_link python:item_type in view.use_view_action and item_url+'/view' or item_url;
item_is_event python:view.is_event(obj);
item_has_image python:item.getIcon;
item_alt_text python:item.alt_text;
item_type_class python:('contenttype-' + view.normalizeString(item_type)) if showicons else '';
">
<metal:block define-slot="entry">
Expand Down Expand Up @@ -161,7 +162,7 @@
<a tal:attributes="
href python:item_link;
">
<img tal:replace="structure python:image_scale.tag(item, 'image', scale=thumb_scale_list, css_class=img_class, loading='lazy')" />
<img tal:replace="structure python:image_scale.tag(item, 'image', scale=thumb_scale_list, css_class=img_class, loading='lazy', alt=item_alt_text)" />
</a>
</div>
</article>
Expand Down
4 changes: 2 additions & 2 deletions plone/app/contenttypes/browser/templates/listing_album.pt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<div class="card-image d-flex justify-content-center align-items-center"
style="height: 14rem;"
tal:define="
scale python:image_scale.tag(image, 'image', scale='mini', loading='lazy');
scale python:image_scale.tag(image, 'image', scale='mini', loading='lazy', alt=image.alt_text);
"
tal:condition="scale"
>
Expand Down Expand Up @@ -79,7 +79,7 @@
<div class="card-image d-flex justify-content-center align-items-center"
style="height: 14rem;"
tal:define="
scale python:image_scale.tag(album, 'image', scale='mini', loading='lazy') if getattr(album, 'image', None) else None;
scale python:image_scale.tag(album, 'image', scale='mini', loading='lazy', alt=image.alt_text) if getattr(album, 'image', None) else None;
"
tal:condition="scale"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<a tal:attributes="
href item_link;
">
<img tal:replace="structure python:image_scale.tag(item, 'image', scale=thumb_scale_summary, css_class='image-responsive thumb-' + thumb_scale_summary, loading='lazy')" />
<img tal:replace="structure python:image_scale.tag(item, 'image', scale=thumb_scale_summary, css_class='image-responsive thumb-' + thumb_scale_summary, loading='lazy', alt=item.alt_text)" />
</a>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@

<td>
<a tal:condition="python:item_has_image and thumb_scale_table">
<img tal:replace="structure python:image_scale.tag(item, 'image', scale=thumb_scale_table, css_class=img_class, loading='lazy')"
<img tal:replace="structure python:image_scale.tag(item, 'image', scale=thumb_scale_table, css_class=img_class, loading='lazy', alt=item.alt_text)"
tal:attributes="
href python: item_link;
"
Expand Down

0 comments on commit 0a3fb93

Please sign in to comment.