We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7231
    • 4,205 Posts
    OK, this time I am sure I figure it out (I hope). The problem was that the snippet was checking if the current doc was a parent and not the doc in the menu. To corrent this all you need to do is add the &id=`[+wf.docid+]` to the snippet call.

    <li[!isParent? &id=`[+wf.docid+]`!]><a href="[+wf.link+]">[+wf.linktext+]xxx</a>
    	[+wf.wrapper+] 
    </li>


    Silly mistake...oh well live and learn shocked

    Let me know if this works grin
      [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

      Something is happening here, but you don&#39;t know what it is.
      Do you, Mr. Jones? - [bob dylan]
      • 24531
      • 213 Posts
      finally it works! thanks a lot. i’ve made a couple of silly mistakes too while trying to make this work...

      nb: don’t try to configure wayfinder under heavy influence. it could be very dangerous for your mental health grin

      btw i modified snippet isParent a little bit:
      <?php
      $id = isset( $id )? $id: $modx->documentIdentifier;
      //$child = $modx->getChildIds($id);
      $child = $modx->getDocumentChildren($id,1,0,'hidemenu', 'hidemenu=0'); //from hasChildren snippet :D
      if($child){
      	return 'class="fly"';
      } else {
      return '';
      }
      ?>
      

      and the snippet call as follows:
      [!isParent? &id=`[+wf.docid+]`!] (uncached)
      [[Wayfinder? ... ]] (cached)

      btw it’ll be nice config pack
        • 7231
        • 4,205 Posts
        cool grin grin
          [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

          Something is happening here, but you don&#39;t know what it is.
          Do you, Mr. Jones? - [bob dylan]
          • 20289
          • 958 Posts
          I’m Wondering all these solutions within forum topics goes deep in the archives and its hard to be found by someone else who has the same issue!, when was the last time you have figured the issue right by browsing many topics that barely matches the exact issue of yours?
          I would love to add stuff to the wiki but honestly my English sucks! wink

          EDIT: Typo correction grin
            [img]http://i10.tinypic.com/52c4eir.gif[/img][/td]
            [td][Wiki] [Persian support forum]
            [SVN] [RTL SVN Branch] [bugs] [FishEye+Crucible] [Learn MODx!] | [My Google Code]
            [font=tahoma][برای دسترسی به راهنمای فارسی به [url=http://www.modxcms.ir]
            • 7231
            • 4,205 Posts
            I would love to add stuff to the wiki but honestly my English sucks!
            Feel free to send me anything if you want help with ’fixing’ the english. But then we may need someone else to fix my typos grin

            I have a few planned wiki additions but just haven’t had the time to get it together. There are also a few items that could be updated. I agree there could be a better way to find things.
              [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

              Something is happening here, but you don&#39;t know what it is.
              Do you, Mr. Jones? - [bob dylan]
              • 7455
              • 2,204 Posts
              why not using the &parentClass?

              I needed this also in the latest config I made:
              http://modxcms.com/forums/index.php/topic,21949.0.html

              I used
              &parentClass=`menu-[+wf.docid+] drop`;


              this only works in the config I think.

              but it works great
                follow me on twitter: @dimmy01
                • 24531
                • 213 Posts
                didn’t test &parentClass but i think it’ll give such class to ALL parents and i don’t need it for 1 level.
                  • 7455
                  • 2,204 Posts
                  Quote from: rav3n at Jan 23, 2008, 07:23 AM

                  didn’t test &parentClass but i think it’ll give such class to ALL parents and i don’t need it for 1 level.

                  its not a problem if all parets get it just skip those in your css
                    follow me on twitter: @dimmy01
                    • 7231
                    • 4,205 Posts
                    why not using the &parentClass?
                    That would have worked but IMO would have left ’dirty’ code with class that were not used/needed. This could also confuse anyone, including yourself, when doing any future work on the site. However with this method you could create a config pack and not need a snippet, that would be nice. wink

                    It would be nice to have the WF class assignment be as segmented as the templates, for example a innerParentClass setting would have worked here. Maybe have a more flexible PHx style setup where you could set the level classes in one step on a level to level basis like this:
                    &levelClass=`level:2,active:here,parent:fly` this would set the active and parent classes on level2 menu items. grin

                    &parentClass=`menu-[+wf.docid+] drop`;

                    This is cool, I never realized that you could build dynamic classes in this manner. That is a great tip, I am sure that I will use this in the future. Building on MotSmart’s comment it would be fantastic to have a Wayfinder wiki with all these user contributed tips.
                      [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                      Something is happening here, but you don&#39;t know what it is.
                      Do you, Mr. Jones? - [bob dylan]
                      • 20289
                      • 958 Posts
                      Quote from: dev_cw at Jan 23, 2008, 05:36 AM

                      Feel free to send me anything if you want help with ’fixing’ the english. But then we may need someone else to fix my typos grin

                      Alright then, i used to add the wiki worth forum links to the wiki wanted pages but, I’ll send you the tricks with the links to the reference and to the destination page of wiki, I have added a very much needed link of How to Get involve in wiki’s index page, & i know it sounds parallel to some other help page or wiki worth topics page but, This might be a container of all the information needed to wiki’s possible contributors, like how they can add some articles or why there is a need of doing so, As i think they might be thinking of a wiki as of official documentation and they simply forget about involving there, Here we talk about those people who are just shy of asking or finding how they can add something they know, Or we can add some notes about gathering tiny pieces of information by anyone, Even we can make some another category like [[to be compeleted]] that only contains tiny raw information about the tricks in a MODx resource usages, and ask someone who knows the smartest way to get it done, At least we will make some motivation to whomever could possibly make a page without the lack of english grammar and typos grin wink

                      BTW the idea of dynamic classes is exciting, ill look into the wayfinder’s wiki page.
                        [img]http://i10.tinypic.com/52c4eir.gif[/img][/td]
                        [td][Wiki] [Persian support forum]
                        [SVN] [RTL SVN Branch] [bugs] [FishEye+Crucible] [Learn MODx!] | [My Google Code]
                        [font=tahoma][برای دسترسی به راهنمای فارسی به [url=http://www.modxcms.ir]