Nov 21, 2008, 08:20 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Search via SMF or Google: modx forums all of modxcms.com web
  MODxCMS.com   Forums   Help Login Register  
Pages: 1 [2]   Go Down
  Print  
Author Topic: [Snippet] Access Keys with DropMenu  (Read 6301 times)
0 Members and 1 Guest are viewing this topic.
Briggsy
Sr. Member
****
Posts: 372



WWW
« Reply #15 on: Mar 01, 2006, 01:34 AM »

Is there any way to stop the snippet from adding [Alt+] when there is no access key assigned?

I only want a few menu items to have an access keys, yet every menu item gets the [Alt+] added to the pop up description.

I notice in the snippet there is the following line  which appears from my limited knowledge to only add it if it is set but that doesn't seem to work in my case. ((isset($accessKey['accessKey'])) ? ' [Alt+'.$accessKey['accessKey']

Code:
'<a '.((isset($accessKey['accessKey'])) ? 'accesskey="'.$accessKey['accessKey'].'" ' : '').'href="[~'.$child['id'].'~]" title="'.$child[$titleOfLinks].((isset($accessKey['accessKey'])) ? ' [Alt+'.$accessKey['accessKey'].']' : '').'">'.$pre.$child[$textOfLinks].$post.'</a>';
« Last Edit: Mar 01, 2006, 01:44 AM by Briggsy » Logged

Emergency Management Academy of New Zealand
      http://www.emanz.ac.nz

MODx Sandbox   Login: sandbox  Password: castle

Admin Sandbox   Login: sandbox  Password: castle
Kunal Kapoor
Full Member
***
Posts: 145


Effective, Functional, Standards Compliant


WWW
« Reply #16 on: Mar 01, 2006, 03:17 AM »

@Briggsy

It should already behave like that. Strange, when I leave my TV blank, then those lines I added to [[DropMenu]] do not execute. Anyone else getting this problem? (You don't have anything set as a default value for your TV do you? No blank spaces?)
Logged

Kunal Kapoor
Technical Director
Limesharp Internet Limited - Effective, Functional, Standards Compliant

IRC Nick: KingKoopa
Skype ID: KingKoopa16
garryn
Coding Team
*
Posts: 1,175



WWW
« Reply #17 on: Mar 01, 2006, 04:48 AM »

Hi Kunal,

I've been getting the same problem as Briggsy, just didn't realise straight the way. It seems the issue for me was using this:

Code:
isset($accessKey['accessKey'])

Using the following fixes the issue for me:

Code:
($accessKey['accessKey']<>'')

I've attached my patched version if you want to try it out (sorry, no change file - this is a Notepad special  Wink ) but the only changes I've made are to the above code.

Hope that helps, Garry



* AccessKeys.txt (15.02 KB - downloaded 336 times.)
Logged

Briggsy
Sr. Member
****
Posts: 372



WWW
« Reply #18 on: Mar 01, 2006, 06:39 AM »

@Kunal: Nope there is no default set at all

@Garry: Your patch worked fine, now running to see what happens  Wink
Logged

Emergency Management Academy of New Zealand
      http://www.emanz.ac.nz

MODx Sandbox   Login: sandbox  Password: castle

Admin Sandbox   Login: sandbox  Password: castle
Kunal Kapoor
Full Member
***
Posts: 145


Effective, Functional, Standards Compliant


WWW
« Reply #19 on: Mar 01, 2006, 09:19 AM »

Thanks very much guys. I have updated the .zip file. Much appreicated garryn.
« Last Edit: Mar 01, 2006, 09:21 AM by Kunal Kapoor » Logged

Kunal Kapoor
Technical Director
Limesharp Internet Limited - Effective, Functional, Standards Compliant

IRC Nick: KingKoopa
Skype ID: KingKoopa16
Pages: 1 [2]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP

Copyright © 2005-2008 MODxCMS, All rights reserved. Contact Us
Styles by ziworks.com

Powered by SMF 1.1.4 | SMF © 2005, Simple Machines LLC

Valid XHTML 1.0! Valid CSS!