We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26435
    • 1,193 Posts
    DropMenu Mod 1.2

    This is a modification to the MODx DropMenu Snippit.
    It adds the ability to set a CSS class and the HTML relationship for the <a> tags in DropMenu, i.e. :

    <li><a href="contact-us.html" class="nameofclass" rel="relationship" title="Contact us through this web form">Contact Us</a></li>

    Set in snippet as [[DropMenu? &linkClass=`nameofclass`]]. When specified in the snippet call, it adds the `class="nameofclass"` as seen above in red. If it is not specified, there is no change to the Drop menu snippet, so you don’t have to worry about it outputting empty class calls i.e. `class=" "`.

    *** edit *** April 3rd 2006

    Set in snippet as [[DropMenu? &rel=`relationship`]]. When specified in the snippet call, it adds the `rel="relationship"` as seen above in blue. If it is not specified, there is no change to the Drop menu snippet, so you don’t have to worry about it outputting empty rel tags, i.e. `rel=" "`.

    This is very beta, so please back up your original DropMenu before you use this. If you use this, please post whether it works for you or it doesn’t.

    enjoy,

    -sD-
    scottyDelicious
      Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
      All of the above... in no specific order.


      I send pointless little messages
      • 26435
      • 1,193 Posts
      I should add, that the focus... the inspiration for this snippet is lightBox-gone-wild. This adds support for lightBox gone wild to MODx. In order to open a link up in a new lightbox with this javaScript, you add `class="lbOn"` to your <a> tags. With this modification to the DropMenu snippet, anyone can add lightBox gone wild to their site!

      http://particletree.com/features/lightbox-gone-wild/

      -sD-
        Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
        All of the above... in no specific order.


        I send pointless little messages
        • 11413
        • 203 Posts
        It’s perfect for what I need! I just need to do that :

        [[DropMenuEx?linkClass=lbOn]]

        and all the pages are shown in Lightbox... you have to create a special template for these documents, but it’s not a big deal when the menu generates itself!
          Blaise Bernier

          www.medialdesign.com - Solutions for small business, hosting, design and more!
          • 26435
          • 1,193 Posts
          Cool Blaise!

          Let us all know when you get your site running! (As of this post, it only shows the construction page).

          -sD-
            Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
            All of the above... in no specific order.


            I send pointless little messages
          • ScottyD, please link to this thread in the tracker in the DropMenu project. Thanks!
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 1876
              • 835 Posts
              Hi

              I try it and I have one error :
              PHP error debug
                Error: 	Missing argument 28 for MakeMap()	 
                Error type/ Nr.: 	Warning - 2	 
                File: 	D:\xampp\htdocs\projet\modx091\manager\includes\document.parser.class.inc.php(691) : eval()'d code	 
                Line: 	200	 
               
                • 26435
                • 1,193 Posts
                hmmm?

                Aour, I got this error the first time I edited it, because I didn’t put the variable in all the maps. When I made sure it was listed in all the map areas, it worked without problems.

                Is anyone else having this issue?

                Aour, can you tell me a bit about your server environment?

                -sD-
                scottyDelicious
                  Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                  All of the above... in no specific order.


                  I send pointless little messages
                  • 1876
                  • 835 Posts
                  Hi

                  I do my test locally with Xampp :

                  Apache/2.0.54 (Win32)
                  PHP/5.0.4
                  MySQL 4.1.13

                  MODx 0.9.1 (rev 646)

                  I switch to PHP/4.4.0 but it’s the same result
                    • 26435
                    • 1,193 Posts
                    I am sorry Aour, but I am unable to recreate the error using the file attached to the first post. Would you humor me, and re-download it from the first post?

                    -sD-
                      Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                      All of the above... in no specific order.


                      I send pointless little messages
                      • 11413
                      • 203 Posts
                      Hi! Now that I got the custom class in the links, I would need to add a custom ’rel’ attribute... would it be possible??

                      thanks a lot!

                      bye,

                      Blaise
                        Blaise Bernier

                        www.medialdesign.com - Solutions for small business, hosting, design and more!