Trace: » url_match » url_start_with » urlbyid » use_helper » pager » pagination » comments » setup_archive_pages » howto » accesskey
Translations of this page?:
General
Getting & Giving Support
Administration
Design
- Tut. - Layouts and Themes
- Tut. - Navigation cookbook
- Tut. - How To section
Reference Material
Plugin Development
- Tut. - Writing a plugin
- Ref. - List of Events
- Ref. - Enabling cron jobs
- Ref. - PHPDoc
Core Development
- Ref. - PHPDoc
Press information
Wolf CMS books section
Menu items with Access Keys
Here is a way to add accesskey's to your navigation links:
<div id="menu"> <ul> <li<?php echo url_match('/') ? ' id="current"': null; ?>><a href="<?php echo URL_PUBLIC; ?>" accesskey="1">Home</a></li> <?php foreach($this->find('/')->children() as $menu): ?> <li<?php echo (url_start_with($menu->url)) ? ' id="current"': null; ?>> <?php // define your accesskey's here if ($menu->slug == 'firstpage') { echo $menu->link($menu->title, (url_start_with($menu->url) ? 'id="current"': null).$options='accesskey="2"'); } elseif ($menu->slug == 'secondpage') { echo $menu->link($menu->title, (url_start_with($menu->url) ? 'id="current"': null).$options='accesskey="3"'); } else { ?> <?php echo $menu->link() . PHP_EOL; } ?></li> <?php endforeach; ?></ul> </div>
Except where otherwise noted, content on this wiki is licensed under the following license:GNU Free Documentation License 1.2
