.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt ===================== EXT: Accessible Menus ===================== :Author: Kasper Skårhøj :Created: 2002-11-01T00:32:00 :Changed by: Ernesto Baschny :Changed: 2006-04-18T09:38:52 :Email: ernst@cron-it.de .. _EXT-Accessible-Menus: EXT: Accessible Menus ===================== Extension Key: **cron\_accessiblemenus** Copyright 2005, 2006, ernst@cron-it.de, This document is published under the Open Content License available from http://www.opencontent.org/opl.shtml The content of this document is related to TYPO3 \- a GNU/GPL CMS/Framework available from www.typo3.com .. _Table-of-Contents: Table of Contents ----------------- **EXT: Accessible Menus 1** **Introduction 1** What does it do? 1 Screenshots 2 **Users manual 2** **Adminstration 2** Upgrading from cron\_autoaccesskeys 2 Hook 3 **Configuration 3** **Known problems 4** **To-Do list 4** **Changelog 4** .. _Introduction: Introduction ------------ .. _What-does-it-do: What does it do? ^^^^^^^^^^^^^^^^ With this extention you can generate accessible (i.e. “barrierefrei”) text-based menus. Automatically generates “accesskeys” to the navigational Tags for your TMENU's based on the title of the menu item. Prefixes each MENUITEM with a tag showing the current nesting level **For accesskeys:** The first not yet used character of the title will be used as an accesskey. Optionally you can wrap something around the first occurence of the accesskey in the title, so you can easily simulate Windows-like menus (underlined accesskey). This also works together with gov\_accesskey, in that if an accesskey is defined for an page (field “accesskey”), it will be used instead of auto-generating one. Please note that the usage of accesskeys isn't really recommended anymore because of the lack of a standard behaviour amongst browsers. Refer to `this article `_ (german only) for more information. **For dfn:** The nesting of your HMENU will be used as a base of the generated tags. So on the second level, the third menu item will get a 2.3: prepended. This is based on a script by Jan Wischnat, from schwangau.de. .. _Screenshots: Screenshots ^^^^^^^^^^^ |img-1| .. _Users-manual: Users manual ------------ The user don't need to do anything. If the gov\_accesskey extention is installed, the user that adds content should fill the “accesskey” for a page only if he wants the accesskey to be statically set (i.e. not automatically generated from the title). Otherwise, just leave that field empty. .. _Adminstration: Adminstration ------------- If you want users to be able to override accesskeys manually, install gov\_accesskey. The user will be able to override the accesskey per page. To use the accessibility features for some menu, install the cron\_autoaccesskeys extention and add a call to “user\_cronaccessiblemenus->makeAccessible” on the TMENU's IProcFunc. Activate the .dfn or .accessKeys feature as you like. .. _generated: ((generated)) ^^^^^^^^^^^^^ .. _EXAMPLE: EXAMPLE """"""" Generates a nested list menu: :: temp.listMenu = TMENU temp.listMenu { wrap =
    |
noBlur = 1 IProcFunc = user_cronaccessiblemenus->makeAccessible IProcFunc.accessKeys = 1 IProcFunc.dfn = 1 NO { allWrap =
  • |
  • stdWrap.htmlSpecialChars = 1 } ACT = 1 ACT { wrapItemAndSub =
  • |
  • stdWrap.htmlSpecialChars = 1 } RO = 0 } This will generate a menu. Each A-Tag will get an “accesskey”. First the accesskey from gov\_accesskey will get used. If this is empty (“”), the cron\_autoaccesskey extention will generate the accesskey on its own. Each item will be prepended with a tag with the current nesting level. .. _Upgrading-from-cron-autoaccesskeys: Upgrading from cron\_autoaccesskeys ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If you use cron\_autoaccesskeys, this extention will replace that one. To upgrade, just install the new extention and change your menu's in your TypoScript template: **Before (with cron\_autoaccesskeys):** :: IProcFunc = user_cronautoaccesskeys->addAccessKeys **After (with cron\_accessiblemenus):** :: IProcFunc = user_cronaccessiblemenus->makeAccessible IProcFunc.accessKeys = 1 IProcFunc.dfn = 1 .. _Hook: Hook ^^^^ The makeAccessible function can be extented by other extentions using the included hook. Create a function that will transform the menuArray (and return it!) Add a hook to cron\_accessiblemenus: :: $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/cron_accessiblemenus/class.user_cronaccessiblemenus.php']['makeAccessible']) = Your function will be called with one parameter only: an array with a 'cObj' item, which will be a reference to the calling object. This will have a property called 'menuArray' and another called 'conf', with which you can work with. Don't forget to return the (possible transformed) menuArray! **Example** : This will do nothing at all: :: function user_AccessibleMenu { $parms} { return $parms['cObj']->menuArray; } .. _Configuration: Configuration ------------- The IProcFunc can be configured with the following options: .. ### BEGIN~OF~TABLE ### .. _dfn: dfn ^^^ .. container:: table-row Property dfn Data type boolean Description Activate the generation of tags Default 0 .. _dfn-menuSet: dfn.menuSet ^^^^^^^^^^^ .. container:: table-row Property dfn.menuSet Data type string Description Set this to the same value to keep the counter across multiple TMENU's. Without a menuSet, each TMENU's dfn-count starts with “1”. **Example:** :: temp.listMenu = TMENU temp.listMenu { .. IProcFunc = user_cronaccessiblemenus->makeAccessible IProcFunc.dfn = 1 IProcFunc.dfn.menuSet = mainmenu .. } Use this, for example, if you compose your menu in a COA of different HMENU's. Use this TMENU in all your HMENU's that you use to compose your “mainmenu”, and the counter will be continue across them. The counter will also respect the nesting level. Default .. _dfn-start: dfn.start ^^^^^^^^^ .. container:: table-row Property dfn.start Data type integer Description Start the dfn counter for this level at a different value. This will also respect dfn.menuSet, so that the counter will just start at this value in the first TMENU of a set. Default 1 .. _dfn-stdWrap: dfn.stdWrap ^^^^^^^^^^^ .. container:: table-row Property dfn.stdWrap Data type +stdWrap Description Pass the generated value through the stdWrap function. This allows you to add a prefix or suffix to your dfn. **Example:** :: temp.listMenu = TMENU temp.listMenu { .. IProcFunc = user_cronaccessiblemenus->makeAccessible IProcFunc.dfn = 1 IProcFunc.dfn.stdWrap.noTrimWrap = |1.| | .. } This will prefix the dfn content with “1.” and suffix it with a “space”. Default .. _dfn-inATag: dfn.inATag ^^^^^^^^^^ .. container:: table-row Property dfn.inATag Data type boolean Description If set to true, it will place the tag inside the
    tag, if present. Default behaviour (false) is to place the tag right after the
  • tag. Refer to `this article `_ (german only) for more information on when to use which method. Default 0 .. _accessKeys: accessKeys ^^^^^^^^^^ .. container:: table-row Property accessKeys Data type boolean Description Activate the addition of accesskeys Default 0 .. _accessKeys-noAutoGenerated: accessKeys.noAutoGenerated ^^^^^^^^^^^^^^^^^^^^^^^^^^ .. container:: table-row Property accessKeys.noAutoGenerated Data type boolean Description Deactivates the auto-generation of access-keys. Set this to true to get only the access-keys set in the gov\_accesskey field. Default 0 .. _accessKeyWrap: accessKeyWrap ^^^^^^^^^^^^^ .. container:: table-row Property accessKeyWrap Data type wrap Description The first occurrence of the accesskey in the title will get this wrap wrapped around it. Useful to highlight the accesskey of a menu item. **Example:** :: temp.listMenu = TMENU temp.listMenu { .. IProcFunc = user_cronaccessiblemenus->makeAccessible IProcFunc.accessKeyWrap = | .. } Default .. _appendWrap: appendWrap ^^^^^^^^^^ .. container:: table-row Property appendWrap Data type wrap Description This will get appended to the title, wrapping around the used accesskey. **Example:** :: temp.listMenu = TMENU temp.listMenu { .. IProcFunc = user_cronaccessiblemenus->makeAccessible IProcFunc.appendWrap =  (ALT- | ) .. } Default .. _forbiddenKeys: forbiddenKeys ^^^^^^^^^^^^^ .. container:: table-row Property forbiddenKeys Data type string Description A comma separated list of characters that should never be used in auto-generated accesskeys. This is useful if you already have a couple of accesskeys being used in your main template and don't want other menu items to use them (e.g. ALT-0 to go to the start page). **Example:** :: temp.listMenu = TMENU temp.listMenu { .. IProcFunc = user_cronaccessiblemenus->makeAccessible IProcFunc.forbiddenKeys = 0,D,B,A,F,X .. } Default .. ###### END~OF~TABLE ###### .. _generated: ((generated)) ^^^^^^^^^^^^^ .. _generated: ((generated)) """"""""""""" .. _Examples: Examples ~~~~~~~~ This will generate a simple text-based menu with accessible features (dfn and accesskeys): :: temp.listMenu = TMENU temp.listMenu { wrap =
      |
    noBlur = 1 IProcFunc = user_cronaccessiblemenus->makeAccessible IProcFunc.accessKeys = 1 IProcFunc.dfn = 1 IProcFunc.accessKeyWrap = | IProcFunc.appendWrap =  (ALT- | ) IProcFunc.forbiddenKeys = 0,D,B,A,F,X NO { allWrap =
  • |
  • stdWrap.htmlSpecialChars = 1 } ACT = 1 ACT { wrapItemAndSub =
  • |
  • stdWrap.htmlSpecialChars = 1 } RO = 0 } Here, the current accesskey will be highlighted in the title (CSS- class “accessKey”) and an accessible text will be appended to the title (ALT-). The keys 0, D, B, A, F, X will never be used for auto-generating, only if the user explicitly set them with gov\_accesskey. .. _Known-problems: Known problems -------------- If you override an accesskey with gov\_accesskey later in the menu, it might already have been used, so it will be double-booked. .. _To-Do-list: To-Do list ---------- Nothing so far .. _Changelog: Changelog --------- **0.1.0** : First public version (cron\_autoaccesskeys) **0.2.0** : (cron\_autoaccesskeys) - Added forbiddenKeys option - Will now render the accesskey provided by gov\_accesskey, if one is set. So you now don't need to patch TYPO3 anymore to get accesskeys working. **0.3.0** : renamed to cron\_accessiblemenus and added functionality and hook **0.4.0** : - added **dfn.menuSet** settings, which allows to continue the counter in the across multiple TMENU's. - added **dfn.stdWrap** setting to be able to wrap something around the dfn-content. - added **dfn.start** setting to be able to start counting from another number **0.5.0** : fixed documentation fixed: Now it won't break any stdWrapped “page.meta.<>” setting anymore (e.g. mc\_autokeywords). **0.6.0** : added: new option accessKeys.noAutoGenerated to use only gov\_accessible access-keys (suggestion by Bjoern Kraus) changed: no hardcoded “:” after the dfn anymore. You can add the “:” or any other string after the dfn value using the dfn.stdWrap property (suggestion by Bjoern Kraus) **0.7.0** : - added: new option dfn.inATag (suggestion by Ingo Renner) - updated: documentation now discourages the usage of accesskeys, linking to an article about accessible menus (suggestion by Ingo Renner) |img-2| EXT: Accessible Menus - 5 .. ######CUTTER_MARK_IMAGES###### .. |img-1| image:: img-1.png .. :align: bottom .. :border: 0 .. :height: 361 .. :id: Grafik1 .. :name: Grafik1 .. :width: 195 .. |img-2| image:: img-2.png .. :align: left .. :border: 0 .. :height: 32 .. :id: Graphic1 .. :name: Graphic1 .. :width: 102