Skip to content

Commit 5e84ef3

Browse files
author
Oleg Zinoviev
committed
MAGETWO-32190: WAI-ARIA in Product Item on Category page and Related Products
- Title code updated.
1 parent 5416aa2 commit 5e84ef3

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

app/code/Magento/Catalog/view/frontend/layout/catalog_category_view.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@
8282
</block>
8383
</referenceContainer>
8484
<referenceBlock name="page.main.title">
85+
<arguments>
86+
<argument name="id" xsi:type="string">page-title-heading</argument>
87+
<argument name="add_base_attribute_aria" xsi:type="string">page-title-heading toolbar-amount</argument>
88+
</arguments>
8589
<block class="Magento\Catalog\Block\Category\Rss\Link" name="rss.link" template="Magento_Catalog::category/rss.phtml"/>
8690
</referenceBlock>
8791
</body>

app/code/Magento/Theme/view/frontend/templates/html/title.phtml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,18 @@
1212
$cssClass = $block->getCssClass() ? ' ' . $block->getCssClass() : '';
1313
$title = '';
1414
if (trim($block->getPageTitle())) {
15-
$title = '<span class="base" data-ui-id="page-title" ' . $block->getAddBaseAttribute() . '>' . $block->escapeHtml($block->getPageTitle()) . '</span>';
15+
$title = '<span class="base" data-ui-id="page-title" ' . $block->getAddBaseAttribute() . '>'
16+
. $block->escapeHtml($block->getPageTitle()) . '</span>';
1617
}
1718
?>
1819
<?php if ($title): ?>
1920
<div class="page-title<?php echo $cssClass; ?>">
20-
<h1 class="title"><?php echo $title ?></h1>
21+
<h1 class="title" <?php if ($block->getId()): ?> id="<?php echo $block->getId();?>" <?php endif; ?>
22+
<?php if ($block->getAddBaseAttributeAria()): ?>
23+
aria-labelledby="<?php echo $block->getAddBaseAttributeAria(); ?>"
24+
<?php endif; ?>>
25+
<?php echo $title ?>
26+
</h1>
2127
<?php echo $block->getChildHtml(); ?>
2228
</div>
2329
<?php endif; ?>

0 commit comments

Comments
 (0)