We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5338
    • 35 Posts
    In DropMenu sometimes "here" class is not generated if a page has children.

    And always, in all my sites it keeps on generating anchor tag for the current page even if you state otherwise with the right parameter.

    look at http://xmod.dev3.net/dropmenu.html where I created a child page ("child one") just on the top of a fresh installed demo site.

    But it seems that on my virtual dedicated server (with godaddy) there is also another strange behaviour, as here class is not generated at all in the current page, if it has children.

    Please check that page and try to navigate (they are nonsense text, but it appears visible soon what I’m talking about embarrassed):

    Is this a bug? huh

    Thanks in advance.

    P.S:

    Web Server:
    ----------------
    PHP version: 4.3.11
    MySQL version 3.23.58
    Operating System and version: Linux Fedora 2.4.20-021stab028.3.777-enterprise / Apache/2.0.51 (Fedora)

    Browser/Client:
    -----------------
    Browser name and version: Both latest IE 6 and Firefox 1.5
    Operating System and version: XP SP2
    • Please include the snippet call you are using so we can see any potential problems in the parameters.
        • 5338
        • 35 Posts
        Just plain [[DropMenu]] or [!DropMenu!]... sad
        Do you want me to PM you login info?
          • 5338
          • 35 Posts
          Please someone reply me! I think this is a serious bug (if it is a bug), because it affects seriously the usability factor! undecided
          • It’s not a bug. It’s an intended behavior. You can create alternate stylings based on the li and the a elements. Many would argue that it’s more proper to not have a link to the current page since you’re already there.

            You can certainly modify the logic to suit your needs though.
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 5338
              • 35 Posts
              @rthrash

              thank you very much for your answer.

              I’ve just realized that I didn’t write about this topic’s subject.

              Many would argue that it’s more proper to not have a link to the current page since you’re already there.

              I agree 100% with them. Unfortunately my language skills are not helping me to explain clearly.

              The behaviour I think it’s a bug is that DropMenu keeps on showing the <a> tag even on the current page.
              As you can see at http://xmod.dev3.net/quickstart/dropmenu.html and http://xmod.dev3.net/quickstart/dropmenu/child-one.html.

              This bug seems to affect just menu items that are below the second level AND that are folders. For example it doesn’t affect this url:http://xmod.dev3.net/pasqua.html (because it’s on the first level) or this url: http://xmod.dev3.net/pasqua/pasquetta.html (because it’s not a folder).

              But if you, for example, add a child under http://xmod.dev3.net/pasqua/pasquetta.html, you will have the same behaviour: <a> tag still appear on the current (folder) page.

              If you delete and purge http://xmod.dev3.net/pasqua/pasquetta.html’s child you just created, it keep on showing <a> tag until you uncheck its "Folder?" checkbox.

              Maybe this happens just on my server. If this is the case, and you can’t replicate this on a server of yours, would you have admin access into my server? I can PM you with password.

              Thank you again for your free support. I appreciate it very much.
                • 6726
                • 7,075 Posts
                I have to admit so far I have not used DropMenu to build multi-level menus, but now that I do I concur with cino I have the very same problem of hereClass not being applied to the folder if it has children.

                More precisely, the hereClass of the folder is applied only if I am viewing the children, as if I were "one level off"...

                It might be that I am not doing things right css-wise though... could anyone give us a hand there ?

                Thanks !

                Here is the call to DropMenu I use :
                [!DropMenu? &startDoc=`0` &levelLimit=`3` &textOfLinks=`menutitle` &selfAsLink=`true` &hereClass=`actif`!]


                and the CSS :

                #menu ul {padding: 0;
                margin: 0; 
                display: inline;
                list-style: none;
                background-color: transparent;
                }
                
                #menu ul li
                {position: relative;
                display: block;
                width: 210px;
                height: 29px;
                background-color: transparent;
                text-align: left;
                font-weight: bold;
                letter-spacing: 1px;
                }
                
                #menu ul li a:link, #menu ul li a:visited 
                {padding-top: 7px;
                padding-left: 30px;
                height: 22px;
                display: block;
                margin: 0 0 0 0;
                border: 1px solid white;
                text-decoration: none;
                color: white;
                background-color: #2B437F;
                }
                
                #menu ul li a:hover, #menu ul li a:active
                {padding-top: 7px;
                padding-left: 30px;
                height: 22px;
                display: block;
                margin: 0;
                border: 1px solid white;
                text-decoration: none;
                color: white;
                background-color: #990000;
                }
                
                #menu ul li.actif a:link, #menu ul li.actif a:visited {padding-top: 7px;
                padding-left: 30px;
                height: 22px;
                display: block;
                margin: 0;
                border: 1px solid white;
                text-decoration: none;
                color: white;
                background-color: #DF0000;
                }
                
                #menu ul li ul {position: absolute;
                z-index: 1000;
                left: 209px; 
                top: 0;
                display: none;
                opacity: .7;
                filter: alpha(opacity=70);
                }
                
                #menu ul li:hover ul {display: block; 
                }
                
                


                If you need to see the page, I’ll send it to you via PM, since it’s a website I am developping for a client and is not public yet...


                @Cino : about the "it’s more proper to not have a link to the current page since you’re already there", if I am not mistaken you can define this with selfAsLink :

                // $selfAsLink [ true | false ]
                // Define if the current page should be a link (true) or not (false)
                $selfAsLink = (!isset($selfAsLink)) ? false : ($selfAsLink==true);
                  .: COO - Commerce Guys - Community Driven Innovation :.


                  MODx est l&#39;outil id
                  • 5338
                  • 35 Posts
                  I modified the code and corrected the bug (It was definitively a bug!).

                  Original code just omitted to consider as simple text all items below the first level and wrote always an anchor.

                  Now I corrected it, it works well. I also made an option to insert a <span id="id_here">item text</span> to make different just current item, since I couldn’t arrange it by css.

                  I also embedded activeTreeOnly hack by Lammikko.

                  You can see it at work at xmod.dev3.net/.
                    • 6726
                    • 7,075 Posts
                    Quote from: cino at Jun 12, 2006, 04:04 PM
                    I modified the code and corrected the bug (It was definitively a bug!). Original code just omitted to consider as simple text all items below the first level and wrote always an anchor.

                    Now I corrected it, it works well. I also made an option to insert a <span id="id_here">item text</span> to make different just current item, since I couldn’t arrange it by css.

                    I also embedded activeTreeOnly hack by Lammikko.

                    You can see it at work at xmod.dev3.net/.

                    That’s nice to know but could you share the code please ?
                    At least, the fix to DropMenu, that would be most appreciated !

                    (I didn’t realize you meant the hack posted by hgw
                    It doesn’t do what I need to do...)

                    I must have gone wrong in the CSS...

                      .: COO - Commerce Guys - Community Driven Innovation :.


                      MODx est l&#39;outil id
                      • 5338
                      • 35 Posts
                      I modified this part of code starting from scratch. I wrote that I also embedded that hack in my DropMenu version.

                      I can’t share it in this very moment. At the moment I have a big trouble with all my modx installations. As you can see you can’t even access to the site I showed in the previous post.

                      It seems that just modx applications and horde stopped working, suddenly. Maybe a php.ini change?