Patch for better accessibility by making the title attribute always populated
hotspoons - November 5, 2009 - 04:59
| Project: | Taxonomy Menu |
| Version: | 6.x-2.4-beta3 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
| Issue tags: | accessibility, taxonomy menu |
Jump to:
Description
Here is a small, 1 line change to the latest (from 10.31.09) stable version of the module that checks to see if the description field is empty, and if it is, uses the term name for the link title attribute instead. This was necessary to pass 508 compliance for one of my current projects as the vocabularies (with hundreds of terms) were imported from a foreign database, the terms had no descriptions, and we're using %lt;canvas%gt; inside of the %lt;a%gt; tags.
--- a/htdocs/sites/all/modules/taxonomy_menu/taxonomy_menu.module Wed Nov 04 23:47:31 2009 -0500
+++ b/htdocs/sites/all/modules/taxonomy_menu/taxonomy_menu.module Wed Nov 04 23:50:04 2009 -0500
@@ -478,7 +478,7 @@
'link_title' => t($item['name']),
'menu_name' => $item['menu_name'],
'plid' => _taxonomy_menu_get_mlid($item['ptid'], $item['vid']),
- 'options' => array('attributes' => array('title' => t($item['description']))),
+ 'options' => array('attributes' => array('title' => t(trim($item['description']) ? $item['description'] : $item['name']))),
'weight' => $item['weight'],
'module' => 'taxonomy_menu',
'expanded' => variable_get('taxonomy_menu_expanded_'. $item['vid'], TRUE),| Attachment | Size |
|---|---|
| taxonomy_menu_accessibility.patch | 723 bytes |

#1
Thanks hotspoons. Since this is an extremely minor (but good) change, I commited it and set this issue to fixed.
#2
Automatically closed -- issue fixed for 2 weeks with no activity.