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

    I want to use Lightbox Gone Wild to show my website content, but to do so I would need to have a custom class added to the <li> of the dropmenu. How can I do it ??

    thanks in advance,

    Blaise
      Blaise Bernier

      www.medialdesign.com - Solutions for small business, hosting, design and more!
    • Hmmm... describe what you want in a feature request and we’ll see if it can happen for the next release (bugtracker request that is...)
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 11975
        • 2,542 Posts
        Hi,

        I’ve made a couple of changes in dropMenu to achieve this.
        I’ve posted the tip in french Forum.

        I copy and Paste the way I’ve realized the hack.

        Hope this help.

        Create a new TV called -> idCssMenu (text)

        Duplicate DropMenu and made these changes

        - Added after line 224:

        $myTv =  $modx->getTemplateVar('IdCssMenu',$fields='*',$child['id']);
        

        - line 262 (<p> tags are specifics to my needs)
        ($myTv !='' ) ? $idCss = 'id="'.$myTv['value'].'": $idCss ='';               
        $output .= "    <li $idCss class=\"$hereClass". ($numChildren == 0 ? ' last' : '')."\">$itm<p>".$child['introtext']."</p></li>$ie";
        


        - and line 297
        <li $idCss $class>$itm$desc</li>$ie";
        



        EDIT: I guess you ’ll have to modidfy more lines after 262 because I didn’t need to custom sublevel
          Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
          • 11413
          • 203 Posts
          It’s not a bad idea! But i was wrong... I needed a class in the link, not the <li>... Anyway, Scotty Delicious is working on an extended version of the Drop Menu and he is supposed to include that specific feature!
            Blaise Bernier

            www.medialdesign.com - Solutions for small business, hosting, design and more!
            • 26435
            • 1,193 Posts
            Quote from: grunt_lord at Mar 31, 2006, 09:44 PM

            It’s not a bad idea! But i was wrong... I needed a class in the link, not the <li>... Anyway, Scotty Delicious is working on an extended version of the Drop Menu and he is supposed to include that specific feature!

            And....
            Revision 0.1 is done. You can check it out here:

            http://modxcms.com/forums/index.php/topic,3724

            later

            -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
              • 11975
              • 2,542 Posts
              @ grunt_lord
              I thought that you wanted to set a different class to each <li> that’s why I proposed this hack. smiley
                Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                • 11413
                • 203 Posts
                hehe... at first i thought i wanted to modify the <LI> too wink
                  Blaise Bernier

                  www.medialdesign.com - Solutions for small business, hosting, design and more!
                  • 7455
                  • 2,204 Posts
                  Dit Ryan not give an example a while ago (I searched can not find it any more) to use the &pre and the &post tag to generate a custom style tag for eacht document depending on the id?

                  somthing like &pre=`
                    follow me on twitter: @dimmy01
                  • That would actually put in the id of the current document, but that would indeed work. You could also create a unique ID by using the counter in the for loop though.
                      Ryan Thrash, MODX Co-Founder
                      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                    • I’ve done that when I wanted to have a different background for each main menu item. I simply added an incrementing variable into the MakeMap loop and appended it to the LI class specified in the snippet options when the <li... tag is being generated.

                      <ul class="topnav">
                      <li class="category1">Item One
                      ...submenu
                      </li>
                      <li class="category2">Item Two
                      ...submenu
                      </li>
                      <li class="category3">Item Three
                      ...submenu
                      </li>
                      <li class="last category4">Item Four
                      ...submenu
                      </li>
                      </ul>

                        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