Page 1 of 1

[solved] accesskey / menu manager PHP

Posted: Sat Feb 09, 2008 10:48 am
by barry cooper
Hi All,

I have been trying to modify this following menumanager template to work with accesskeys

{if $count > 0}


{foreach from=$nodelist item=node}
current == true or $node->parent == true} class="tab-selected"{/if}>url}"{if $node->target ne ""} target="{$node->target}"{/if}>{$node->menutext}
{/foreach}


{/if}

This code was taken from one of the download templates.  I have attempted to cut in bits of the standard templates, but as soon as I fix some thing I break something else.

Any help or pointers welcome.

Thanks

Barry C

Re: accesskey / menu manager PHP

Posted: Sat Feb 09, 2008 10:51 am
by RonnyK
What are you trying to achieve. Default CMSMS already works with accesskeys, as they can be passed thorugh the options-tab of a content-page. There is a field, where the accesskey could be entered.

Ronny

Re: accesskey / menu manager PHP

Posted: Sat Feb 09, 2008 11:01 am
by barry cooper
Hi Ronny,

I have put number 1 - 8 into the accesskey field on all of the pages and it does nothing. (using the access keys Alt shift and n (number) to load a given page.
I pulled up one of the preinstalled templates that uses a default menumanager module and that works. 
The only difference I can see is that the menumanager module PHP has accesskey {if} statments in the code.

I think the answer to my problem is to add the correct statments to my code (see above).
My problem is my PHP is not good enough to do this and I need some help.

Does that make any sense?

The site I am working on is http://www.i-listener.com/

Thanks

Barry C

Re: accesskey / menu manager PHP

Posted: Sat Feb 09, 2008 3:02 pm
by alby
barry cooper wrote: I pulled up one of the preinstalled templates that uses a default menumanager module and that works. 
The only difference I can see is that the menumanager module PHP has accesskey {if} statments in the code.

I think the answer to my problem is to add the correct statments to my code (see above)

Does that make any sense?
Yes, you must add the relative code:

Code: Select all

{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}
View code of, for example, simple_navigation. Your code can be (with tabindex also):

Code: Select all

{if $count > 0}

<ul class="tab-menu">
{foreach from=$nodelist item=node}
<li {if $node->current == true or $node->parent == true} class="tab-selected"{/if}><a href="{$node->url}"{if $node->target ne ""} target="{$node->target}"{/if}{if $node->accesskey != ""} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ""}>{$node->menutext}</a></li>
{/foreach}
</ul>

{/if}

Alby

Re: accesskey / menu manager PHP

Posted: Sat Feb 09, 2008 5:34 pm
by barry cooper
Thanks Alby,

A few small changes and it worked (code below).  This code works with menu items that are live in the main menu pages.
Pages that are not in the main menu need to be hardcoded to make use of accesskeys.

project: www.i-listener.com

Thanks again

Barry C



{if $count > 0}


{foreach from=$nodelist item=node}
current == true or $node->parent == true} class="tab-selected"{/if}>

url}"{if $node->target ne ""} target="{$node->target}"{/if}{if $node->accesskey != ""} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ""}{/if}>

{$node->menutext}


{/foreach}


{/if}