Custom fields are not displayed properly within definition lists. The definition lists include only <dd>
elements, and not the corresponding <dt>
elements.
Without this fix, definition lists will violate the WCAG 2.0 accessibility standard "Ensures <dl>
elements are structured correctly".
When not empty, element does not have at least one <dt>
element followed by at least one <dd>
element
c.f. https://dequeuniversity.com/rules/axe/3.2/definition-list?application=AxeChrome
$content
needs to be separated into separate elements: the field name (which should populate the dt
element) and the field value (which should populate the dd
element)
Title |
|
||||||
Labels |
Added:
?
|
Title |
|
Sorry this slipped my attention. I will take a look hopefully tomorrow
Sorry this cannot be fixed at a core level in Joomla 3.9 without significant backwards breaking changes.
I have created an issue for Joomla 4 and will be working over the next week to resolve this
Closed_By | brianteeman | ⇒ | joomla-cms-bot |
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-01-19 12:01:06 |
Closed_By | ⇒ | brianteeman |
Set to "closed" on behalf of @brianteeman by The JTracker Application at issues.joomla.org/joomla-cms/26849
See 27567
Below is one way to make the code accessible. There is probably a better way to do this - if the
<dt>
and<dd>
elements could be shown on the same line with a colon separating them,Insert at line 64 of
components/com_fields/layouts/fields/render.php
:$showLabel = $field->params->get('showlabel');
$label = JText::_($field->label);
$value = $field->value;
(Optional) Suppress hidden labels:
Add new lines 75 - 80:
Modify
$output
statement (formerly line 72, now line 81):$output[] = '<dt class="field-label ' . $class . '">' . $label . '</dt>' . '<dd class="field-value ' . $class . '">' . $value . '</dd>'; }