Documentation

Light-weight, fast, simple and powerful!
 
Translations of this page?:

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>
 
navbook/accesskey.txt · Last modified: 2011-09-12 00:46 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:GNU Free Documentation License 1.2
Copyright 2010 wolfcms.org / design by yello studio / Wolf CMS Inside