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

    I’m new on modx and I want say immediatly sorry for my English. I’m French.
    Ok, presentation is gone. Start the subject.

    I have installed the template made by softwell (page 5 in Template Forums) on November 05.
    You can see results at this link http://www.itanea.com/, navigate on different menu and you’ll see what kind of problem I have.

    I try to modify the andreas06.css file without success. Now, if somebody can help me by taking an idea or a tips to solve my problem.

    Thanks very much, sorry one more time for my poor English and have a nice day.

    Bye Bye.
    Thernius
      • 32847
      • 171 Posts
      Hello,

      just change or add
      &selfAsLink=`true`
      in your snippet call.
      There is no <a> for your ’here’ class
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        But if you use "&selfAslink=`true`" when calling the DropMenu snippet, the links no longer get the "here" class. So the "sliding doors" method of rounded corner images won’t work if you try to change the image for the "here" link. All you can do is change the font size and color for the <li class="here"> element.

        You’ll need to use a menu snippet that adds the .here class and keeps the <a> element at the same time. ListMenuX would be a good choice.
          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
          • 29778
          • 13 Posts
          Ok thanks very much for these tips.
          So, I’m very beginner with modx and I don’t know where I must use (in first time) &selfAslink=`true`; in code. Wich Snippet ? SetDoc, DropMenu ?
          And the syntax is &selfAslink=`true`; or $selfAslink=`true`; ?

          In your second tip, you say I can use ListMenuX Snippet. Ok but how can I change the code to take ListMenuX as snippet to manage Menu ?

          Thanks for your help.

          Thernius.
            • 1876
            • 835 Posts
            Hi

            if you use "&selfAslink=`true`" when calling the DropMenu snippet

            CQFD : DropMenu and &selfAslink

            Using Snippets in your Template
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              That document was written as a generic snippet usage explanation before DropMenu was made the default (it was actually written with ListMenuX in mind, but the principles are the same for all snippets. Read the comments at the beginning of your snippet’s code for optional arguments). In DropMenu, if selfAsLink is set to true as an option, a link is generated but the "here" classname is not added to the <li> tag. And DropMenu never adds class names to the <a> elements, only to the <li> and <ul> elements. It leads to cleaner generated HTML code, but often requires trickier CSS code. Here is the DropMenu specific documentation:

              http://modxcms.com/snippet-dropmenu.html

              (sorry about the lower case l, my poor laptop needs a tuneup for a number of sticky keys, including the left shift key!)

              To use ListMenuX, get the code (I attached it here), create a new snippet and copy/paste the code. Then where you have [!DropMenu...!] put [!ListMenuX...!] instead. Read the comments and the settings at the beginning of the snippet’s code to see the optional arguments you can use. For the template you are using in this case, since you need to style both the <li> and the <a> elements for the "sliding doors" technique, you’ll need to set three arguments:

              [!ListMenuX?id=`0`&activeLinkClass=`active`&activeListClass=`here`!]


              Now you’ll have a menu starting at level 0, 1 level deep (ListMenuX sets the depth to 1 by default), with the active link classes <li class="here"> and <a class="active"> and you can style them both as you like.
                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
                • 29778
                • 13 Posts
                Thanks very much for these tips softwell !!! When I have more time, I try to apply your recommandation.
                I’m very happy to see the reactivity of the community.

                Thernius