We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36805
    • 354 Posts
    Thanks for your replies. It will take some more time before i really grasp every detail of it. But I did succeed in making every dropdown have its own style and thus background-color applied. And all of this by using only one single call to the snippet. I am totally happy laugh

    Respect goes out to Ryan and Kyle for writing this powerful piece of code which extends the amount of control Dropmenu was known to have even further!
      • 15987
      • 786 Posts
      Quote from: stewski at Aug 08, 2006, 06:49 AM

      Wouldn’t it make sense to use a different prefix for each menu instance on a page
      e.g. IDs like "MYMENU1_" and "MYMENU2_" and then append a unique ID (row or page number etc) for each li in a menu?

      If you need to do this you can with wayfinder, all you need to do is change the &rowIdPrefix parameter for each snippet call
        • 28584
        • 27 Posts
        Quote from: kylej at Aug 08, 2006, 08:02 AM

        Quote from: stewski at Aug 08, 2006, 06:49 AM

        Wouldn’t it make sense to use a different prefix for each menu instance on a page
        e.g. IDs like "MYMENU1_" and "MYMENU2_" and then append a unique ID (row or page number etc) for each li in a menu?

        If you need to do this you can with wayfinder, all you need to do is change the &rowIdPrefix parameter for each snippet call

        I see from your earlier post that the flexibility is already there, which is a great thing.

        I guess the discussion is more if it is sensible to set a precedent that the default is uniqueness through out a menu structure? Its tricky I’ve used IDs in XML and idref which is a nice way of semantically marking up (parent/child) structures however I think in xml IDrefs and IDs have to be purely numeric and I don’t know if a similar thing can be achieved in xHTML at the mo.
        I’m no expert on the semantic web and how its supposed to work so Im not sure of the current benefits, still its something worth thinking about for future developments, either way I’m going to set some time aside and play with that snippet I tells you grin

        thanks again.
          • 11975
          • 2,542 Posts
          Kylej,

          Could we add a feature to interpret weblink (type=’reference’ && content is something like [~numeric~]) as alias and not as a document.
          I mean that way we could build menu incorporating easily and accurately  document(id and alias) located outside from the current folder.

          :-)

          EDIT:


          Maybe it could be achieved with something like adding type field line 46
                  $getFields = 'id,menutitle,pagetitle,menuindex,published,hidemenu,parent,isfolder,description,alias,longtitle';
                  $resource = $modx->getActiveChildren($parentId,'menuindex','ASC',$getFields);
          


          and build the link with the content if (type=’reference’ && content is something like [~numeric~])

          $v[’link’] = $modx->makeUrl(numeric);



            Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
            • 10298
            • 53 Posts
            Quote from: PaulGregory at Aug 08, 2006, 07:07 AM

            I’m sure that there are uses for having each item have its own ID, particularly with javascript menus, and yes it could be useful to be able to ensure unique IDs - stewski’s method sounds good and similar to other menu routines I have encountered elsewhere.

            There are many ways of achieving IDs with Wayfinder if one wants to. To clarify my point, people should only add IDs to things if that is going to be useful. IDs are not a requirement of CSS or HTML semantics.

            To apply this false "unique=ID" logic to everything, you would give each paragraph its own ID because they said different things. And you would possibly have to mention every ID in your style sheet. It’s just a misunderstanding of "web standards", and I want to make it clear to everyone that Wayfinder’s default class-not-ID set up is not a "mistake" as FunkyBuddah puts it.
            I am sorry that i have upset you so much.

            What I was suggestioning may have been wrong at some point. For example with the here class. But there is absolutely nothing wrong with attaching an id to the current selected state ´the self class´ From my point of view it would be more logical.

            Some of the great css designers are using the id on the &selfClass instead of a class. For example if you look at the source code on Douglas Bowmans site you will see a
             <ul>
                <li id="current"><strong id="h">Home</strong></li>
            But maybe they are wrong too .
              • 13736
              • 345 Posts
              One of the feature requests I put in for DropMenu a couple months back was the ability to put SPAN tags inside the A tags.

              Example:

              <ul>
                  <li><a href="#"><span>Menu Item 1</span></a></li>
                  <li><a href="#"><span>Menu Item 2</span></a></li>
              </ul>
              



              This would allow a "barn door button" hover effect for IE6. For now, you can see a working example of the short comings here http://modx.acgi.org You’ll notice that the buttons across the top don’t highlight properly during the hover when using IE. They work fine in FireFox. Apparently it’s because of IE’s inability to support a hover option on an LI tag.

              I was wondering if this could be added to Wayfinder. Or can it already do this and I’m not seeing it.

                • 25663 MODX Staff
                • 12,272 Posts
                You can set the Wayfinder templates up in any way you like, so that’s completely possible. In fact, I’m doing just that on a site I’m developing now.

                For hover:anything support in IE, all you need to do is take advantage of the csshover.htc file located in every distribution of MODx in the assets/js/ directory. Then it all starts to work automatically.
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                  • 15987
                  • 786 Posts
                  @heliotrope

                  I’m not sure I understand the need for your request. Won’t the weblink link to the correct location without any further processing?

                  @jbjones

                  to do that just set the &rowTpl param to the following:

                  <li[+wf.id+][+wf.classes+]><a href="[+wf.link+]" title="[+wf.title+]"><span>[+wf.linktext+]</span></a>[+wf.wrapper+]</li>
                    • 13736
                    • 345 Posts
                    How do we take advantage of that csshover.htc file? What exactly does taking advantage of it mean?

                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      It gets called in an IE conditonal in the template head. It forces IE to recognize the :hover pseudoclass for other things besides <a> tags.
                      <!--[if lte IE 6]>
                      <style type="text/css" media="screen, tv, projection">
                      body { behavior: url(assets/js/csshover.htc); } /* hover:anything support */
                      </style>
                      <script type="text/javascript" src="assets/js/sleight.js"></script>
                      <![endif]-->

                      It’s already there in the default MODx template.
                        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

                      This discussion is closed to further replies. Keep calm and carry on.