We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Hi Briggsy,

    Try running the snippet cached, all my problems were because I was calling it uncached.

    Cheers, Garry
      Garry Nutting
      Senior Developer
      MODX, LLC

      Email: [email protected]
      Twitter: @garryn
      Web: modx.com
      • 4095
      • 372 Posts
      Quote from: garryn at Feb 27, 2006, 10:09 AM

      Hi Briggsy,

      Try running the snippet cached, all my problems were because I was calling it uncached.

      Cheers, Garry

      hey garry, sorry my mistake I am calling it cached [[DropMenuAccessKey? textOfLinks=menutitle &titleOfLinks=longtitle]]

      I have tried uncached as well, and with page set to cached and uncached.

      I also put the [*accesskey*] TV in the template in both the Head and in the Body and neither helped
        [img]http://www.emanz.ac.nz/assets/images/logo/emanz-icon_16x16.gif[/img] Emergency Management Academy of New Zealand [br] http://www.emanz.ac.nz[br][br]MODx Sandbox Login: sandbox Password: castle [br]
        Admin Sandbox Login: sandbox Password: castle
        • 15914
        • 145 Posts
        This may sound really silly, and you have probably already checked it, but is your template variable called accesskey or accessKey (as in my specification)? I think they are case sensitive. It sounds like a problem with your TV if you can’t even call it in the template directly.
          Kunal Kapoor
          Technical Director
          Limesharp Internet Limited - Effective, Functional, Standards Compliant

          IRC Nick: KingKoopa
          Skype ID: KingKoopa16
          • 4095
          • 372 Posts
          Quote from: Kunal at Feb 27, 2006, 10:38 AM

          This may sound really silly, and you have probably already checked it, but is your template variable called accesskey or accessKey (as in my specification)? I think they are case sensitive. It sounds like a problem with your TV if you can’t even call it in the template directly.

          yea it was a case isssue, doh. Thanks it works now smiley

          Can I suggest you make the cases more obvious? All lower case except for the "K" is hard to see the case is different, espically from the GIF example.
            [img]http://www.emanz.ac.nz/assets/images/logo/emanz-icon_16x16.gif[/img] Emergency Management Academy of New Zealand [br] http://www.emanz.ac.nz[br][br]MODx Sandbox Login: sandbox Password: castle [br]
            Admin Sandbox Login: sandbox Password: castle
            • 15914
            • 145 Posts
            Quote from: Briggsy at Feb 27, 2006, 11:57 AM

            Can I suggest you make the cases more obvious? All lower case except for the "K" is hard to see the case is different, espically from the GIF example.

            Apologies. I have a naming convention that all my snippets and TVs and Plugins begin with a lower case and then use CamelCasing for the rest of the word. It’s just the way I work. I will amend my first post and write out the details of the TV.

            In fact, what I could do is modify [tt][[DropMenu]][/tt] in such a way that you can define the appropriate TV in a snippet call (e.g. [tt][[DropMenu? &accesskeytv=`accesskeys`]][/tt]) with a default value set of [tt]accessKey[/tt]. I’ll get to work on this at some point today if everyone thinks it to be a good idea.
              Kunal Kapoor
              Technical Director
              Limesharp Internet Limited - Effective, Functional, Standards Compliant

              IRC Nick: KingKoopa
              Skype ID: KingKoopa16
              • 4095
              • 372 Posts
              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’]

              '<a '.((isset($accessKey['accessKey'])) ? 'accesskey="'.$accessKey['accessKey'].'" ' : '').'href="[~'.$child['id'].'~]" title="'.$child[$titleOfLinks].((isset($accessKey['accessKey'])) ? ' [Alt+'.$accessKey['accessKey'].']' : '').'">'.$pre.$child[$textOfLinks].$post.'</a>';
                [img]http://www.emanz.ac.nz/assets/images/logo/emanz-icon_16x16.gif[/img] Emergency Management Academy of New Zealand [br] http://www.emanz.ac.nz[br][br]MODx Sandbox Login: sandbox Password: castle [br]
                Admin Sandbox Login: sandbox Password: castle
                • 15914
                • 145 Posts
                @Briggsy

                It should already behave like that. Strange, when I leave my TV blank, then those lines I added to [tt][[DropMenu]][/tt] 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?)
                  Kunal Kapoor
                  Technical Director
                  Limesharp Internet Limited - Effective, Functional, Standards Compliant

                  IRC Nick: KingKoopa
                  Skype ID: KingKoopa16
                • 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:

                  isset($accessKey['accessKey'])


                  Using the following fixes the issue for me:

                  ($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


                    Garry Nutting
                    Senior Developer
                    MODX, LLC

                    Email: [email protected]
                    Twitter: @garryn
                    Web: modx.com
                    • 4095
                    • 372 Posts
                    @Kunal: Nope there is no default set at all

                    @Garry: Your patch worked fine, now running to see what happens wink
                      [img]http://www.emanz.ac.nz/assets/images/logo/emanz-icon_16x16.gif[/img] Emergency Management Academy of New Zealand [br] http://www.emanz.ac.nz[br][br]MODx Sandbox Login: sandbox Password: castle [br]
                      Admin Sandbox Login: sandbox Password: castle
                      • 15914
                      • 145 Posts
                      Thanks very much guys. I have updated the .zip file. Much appreicated garryn.
                        Kunal Kapoor
                        Technical Director
                        Limesharp Internet Limited - Effective, Functional, Standards Compliant

                        IRC Nick: KingKoopa
                        Skype ID: KingKoopa16