This document lists all template modifications for DOM simplification, semantic HTML improvements, and accessibility enhancements.
markdown_cheatsheet.html.twig<div> to <main> element<header> around page title<div> to <nav> with aria-label<section> elements with IDs<div> to <figure> elementsmedia/index.html.twig<ul>/<li> to semantic <dl>/<dt>/<dd> structureadmin.mediaMosaic.css.media-mosaic__meta styles for <dl> element (CSS grid layout).media-mosaic__meta dt and .media-mosaic__meta dd styles.media-mosaic__meta li and .media-mosaic__meta span styleseditorjs_widget.html.twigreturn false; to onclick handlers to prevent default anchor behavioradmin/messageListTitleField.html.twigclass attribute (merged class="px-1" and class="text-decoration-underline")conversation/conversation.html.twigbg-red text-red → bg-red-100 text-red-700p-3 rounded and role="alert" for better UX and accessibility on error div<div class="flex flex-wrap"> around content blockstep class and empty row_attrconversation/review.html.twigstyle: 'width:14px' with Tailwind class w-3.5<span class="sr-only"> for edit button accessibility<div> around media gallery (uses gallery_container_class parameter instead)component/image.html.twig (new)New unified template for rendering responsive <picture> elements, replacing image_helper.html.twig.
Parameters:
image (Media): Required. Media object to render.mode (string): 'responsive' (all breakpoints) or filter name (e.g. 'thumb', 'xs'). Default: 'responsive'image_class (string): CSS class for img element. Default: 'w-full h-auto mb-4'image_attr (array): Additional img attributes. Default: {}image_alt (string): Alt text. Default: image.altlazy (bool): Enable lazy loading. Default: truepicture_attr (array): Picture element attributes. Default: {style: 'margin:0'}page (Page): Optional. Used to get locale for alt text.component/image_helper.html.twig (removed)Functionality merged into image.html.twig with mode: 'thumb' parameter.
component/card.html.twigimage_helper.html.twig macro importimage.html.twig includecomponent/image_inline.html.twigmedia_from_string() directlyrenderImage macro with image.html.twig includecomponent/images_gallery.html.twiggallery_part macro entirelyimage_helper.html.twig macro import with image.html.twig include<div> wrapper, gallery now renders directly as <ul>gallery_container_class to default gallery class (previously only wrapped container)media_from_string() automatic format detectionpage/_content.html.twig// if content contains... → {# if content contains... #}If you have overridden image_helper.html.twig, update your code:
Before:
{% import view('/component/image_helper.html.twig') as helper %}
{{ helper.thumb(image, page, 'thumb', {class: 'my-class'}) }}
After:
{{ include('@PushwordCore/component/image.html.twig', {
image: media_from_string(image),
mode: 'thumb',
page: page,
image_class: 'my-class'
}, with_context = false) }}
If you have overridden images_gallery.html.twig, note that:
<div class="..."> wrapper has been removedgallery_part macro has been removed (logic is now inline)gallery_class parameter to apply container classes directly to the <ul>Before:
<div class="{{ gallery_container_class|default('my-3') }}">
<ul class="{{ gallery_class|default('grid...') }}">
After:
<ul class="{{ gallery_class|default('my-3 grid...') }}">
If you have overridden any of these templates in your project, review your customizations against the new structure. Key changes to consider:
<main>, <header>, <nav>, <section>, <figure> elements in markdown_cheatsheet.html.twig<dl>/<dt>/<dd> for media metadatasr-only) added for accessibilityimages_gallery.html.twig no longer has outer <div> wrapper