By star-szr on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Description:
WAI-ARIA roles have been added to core module blocks. For more information see WAI-ARIA roles.
The following WAI-ARIA roles were added (if not specified, the role has been added to all blocks output from the module):
- complementary
- aggregator.module
- help.module
syndicateblock in node.module- poll.module
powered-byandhelpblocks in system.modulenewandonlineblocks in user.module
- form
loginblock in user.module
- navigation
- book.module
- comment.module
- forum.module
- locale.module
- menu.module
recentblock in node.module- shortcut.module
- statistics.module
- Menu blocks in system.module
- search
formblock in search.module
Module developers can add WAI-ARIA roles to their blocks by implementing hook_preprocess_block().
/**
* Implements hook_preprocess_block().
*
* Adds 'complementary' WAI-ARIA role to all blocks from this module.
*/
function MYMODULE_preprocess_block(&$variables) {
if ($variables['block']->module == 'MYMODULE') {
$variables['attributes_array']['role'] = 'complementary';
}
}
Impacts:
Module developers
Themers