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

    Is there any way to remove the space between the css class on the navigation third level.
    <li class="here last"> to <li class="herelast">
    Can’t seem to assign a class "here last".

    Actually, I am try to assign a class to the third level navigation.

    I have read the thread on http://modxcms.com/forums/index.php/topic,1310.0.html. But I still couldn’t get the third level selected button linkage to go away.

    This is what I have put in the template
    -----------------------------------------------------------------
    <div class="right_nav">[[DropMenu? &startDoc=`0` &levelLimit=`2` &topdiv=`true` &subnavClass=`nestedLinks`]]</div>
    -----------------------------------------------------------------

    This is the output
    -----------------------------------------------------------------
    <ul class="topnav">

    <li><a href="index.php?id=1" title="">Base Install</a></li>
    <li class="here"><a href="index.php?id=2" title="">test01</a>
    <ul class="nestedLinks">
        <li class="here last"><a href="index.php?id=3" title="">Base Install</a></li>
    </ul>
    </li>
    <li class="last"><a href="index.php?id=4" title="">test02</a>
    <ul class="nestedLinks">
    <li class="last"><a href="index.php?id=5" title="">Duplicate of MODx CMS Install Success</a></li>
    </ul>
    </li>

    </ul>
    -----------------------------------------------------------------

    Thanks alot in advanced.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      "here" is to indicate the link for the current page and its parents. "last" is to indicate the last LI in a UL submenu section. An element can be assigned more than one class name separated by spaces.

      Third level navigation would be ".topnav li ul li ul li" or something of the sort. .topnav is the top UL, so you want to go to a ul that’s in one of its li elements, then go to a ul that’s in one of that ul’s li elements. Kind of convoluted but if you consider it for a few minutes you’ll see the logic of it.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 6935
        • 6 Posts
        Sorry. I may not be very good at CSS.
        I need some assistance. How do we assign a "here last" class in the stylesheet.

        .here last{} /*can this class be assigned?*/
        .here%last {} doesn’t work either.

          • 25663 MODX Staff
          • 12,272 Posts
          .here { styles }
          .last { more styles }

          Based on the above order, .last will override .here (but only for overlapping rules) as it is last in the "cascade". It is useful for

          .last { more styles }
          .here { styles }

          Based on this order, .here will override .last for similar reasons of the cascade. (The "C" in CSS.)
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 6935
            • 6 Posts
            It’s abit confusing. I have tried it out.
            It doesn’t work.

            This is what I am trying to achieve.

            Navigation
            -> link1
            -> link2
            -> link3
              ->link3.1
              ->link3.2  /*Current page*/
              ->link3.3

            How can we achieve that?
            Many Thanks

            Actually, in order to achieve the above, it’s very easy via CSS.
            If only the class does not have a space in between.
            I just need help on removing the space between the class.
            <class="here last"> to <class="herelast">
            <class="last here"> to <class="lasthere">

            Or remove the <a href>....<a> from the current select page.

            Many Many Thanks to You guys that can help. smiley
              • 25663 MODX Staff
              • 12,272 Posts
              There is an option to turn off current as link. Look in the snippet config parameters.
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 6935
                • 6 Posts
                Is it the &hereClass?

                By default it’s false.
                It’s working on the first level nav
                It’s start to lose it’s effect on the sub subnav.
                Which is the 3rd level Nav.

                It is also mention on
                http://modxcms.com/forums/index.php/topic,1310.0.html
                I have try it out. But it doesn’t seem to solve the
                3rd level Nav, current linkage.
                  • 25663 MODX Staff
                  • 12,272 Posts
                  the &hereClass only sets the class to the genealogy of the currnet document. The configuration to turn off the current as link is to set:

                  &selfAsLink=`no`


                  Actually, if you set the selfAsLink to anything, it will turn off a link to the current page you’re on due to the way it’s determined:

                  $selfAsLink = (!isset($selfAsLink)) ? false : ($selfAsLink==true);
                    Ryan Thrash, MODX Co-Founder
                    Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                    • 6935
                    • 6 Posts
                    Sorry, it’s still doesn’t work.
                    When I add &selfAsLink=`no`, all linkage is true.
                    When I add &selfAsLink=’false’, all linkage is true.
                    No matter what I put in the value, all linkage is true.

                    When I remove &selfAsLink=’no’, only the first level navigation function, the Subnav current linkage is still there.

                    The tags in the snippets doesn’t work.
                      • 6935
                      • 6 Posts
                      Thanks for everybody’s help.

                      I have resolve the issue by removing the CSS class space in the snippets.