A screenshot of the Search block configuration from with ARIA landmark role area

Inspired by Block Class, this module adds additional elements to the block configuration forms that allow users to assign a ARIA landmark role to a block.

For further information about ARIA landmark roles, go to http://www.w3.org/WAI/PF/aria or http://www.nomensa.com/blog/2010/wai-aria-document-landmark-roles.


Drupal 7

Ensure that the attributes variable is being printed within your block.tpl.php
file - the block module's default template does this by default. For example:

<div id="<?php print $block_html_id; ?>" class="<?php print $classes; ?>"<?php print $attributes; ?>>

Drupal 6

Within your block.tpl.php, include the following snippet within the opening div tag:

<?php print $aria_role; ?>

Here is the first line of Garland's block.tpl.php before the code is inserted:

<div id="block-<?php print $block->module .'-'. $block->delta; ?>" class="block block-<?php print $block->module ?>">

And here's what the code should look like after adding the snippet:

<div id="block-<?php print $block->module .'-'. $block->delta; ?>" class="block block-<?php print $block->module ?>" <?php print $aria_role; ?>>

IMPORTANT: Remember to separate the PHP snippet from the existing markup with a single space.

#D7AX - I pledge to make this module as accessible as it can be. If you find any flaws, please submit an issue. Help me fix them if you can.

Project information