We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5282
    • 147 Posts
    Hi !
    I’d like to have pictures ( logos ) just before the links of the dropmenu, i’m thinking about creating a new template variable in which i’ll enter the link to the picture for all the documents
    but do you know how to modify the dropmenu snippet to add a t.v. the between the <li> and </li> tags huh

    thanks
      i’m not a native english speaker, sorry if there are any mistakes ! smiley

      Pikkitux.com Website about Ubuntu Linux, Website Creation, and many other how-tos, tips and tricks ... ( French Language, and of course Modx Powered ! )
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      // $pre [ string ]
      // Text to append before links inside of LIs
      $pre = (!isset($pre)) ? ’’ : "$pre";

      // $post [ string ]
      // Text to append after links inside of LIs
      $post = (!isset($post)) ? ’’ : "$post";

      This might work, store the path to the image in the document’s description field, then use something like this:

      &pre=`
        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
        • 5282
        • 147 Posts
        i tried but the dropmenu returns me the description of the current page, not the description of the target page ...

        thx
          i’m not a native english speaker, sorry if there are any mistakes ! smiley

          Pikkitux.com Website about Ubuntu Linux, Website Creation, and many other how-tos, tips and tricks ... ( French Language, and of course Modx Powered ! )
          • 9814
          • 8 Posts
          I’ve done something similar using Invision Power Board and its variables.

          <img src="MODXVARIABLE.gif" alt="" />


          Try putting an image extension onto what sottwell posted
            • 5282
            • 147 Posts
            yes i know, but for example
            i’m on the page 1, which has a dropmenu linking to pages 2 and 3

            the problem i have is that it is the variable of the page 1 that is displayed in the menu and not the variables of pages 2 nor 3
              i’m not a native english speaker, sorry if there are any mistakes ! smiley

              Pikkitux.com Website about Ubuntu Linux, Website Creation, and many other how-tos, tips and tricks ... ( French Language, and of course Modx Powered ! )
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Yes, I see the problem. Here is one solution, hacking the DropMenu snippet:

              In five places replace the $pre with the following:

              $child['description'] .' - '
              


              (the .’ - ’ part is just to make a space of some kind, put whatever you like)

              In my copy, it was lines 135, 236, 244, 245, 251.

              I am sure that there is a way to pass someting in via the &pre= option, maybe using variable variables, but I wasn’t able to figure it out.

              You should probably rename this hacked version of the snippet so it doesn’t get mixed up with regular menus.
                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
                • 5282
                • 147 Posts
                thank you i’m gonna try
                  i’m not a native english speaker, sorry if there are any mistakes ! smiley

                  Pikkitux.com Website about Ubuntu Linux, Website Creation, and many other how-tos, tips and tricks ... ( French Language, and of course Modx Powered ! )