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

    I have a website using the latest version of wayfinder and revo 2.0.4pl2 and I am using &parentClass to add an arrow to items with subpages in a dropdown menu.

    It works however, wayfinder is adding a parent class to 1 item that has NO subpages, and NOT adding it to 1 item that has subpages.

    Any ideas?
      --
      Landon Poburan
      Web Designer and Developer

      http://www.categorycode.ca
      http://www.landonp.com
      • 26016
      • 561 Posts
      Hi,
      I just tested that on my 2.07, and it’s working well.

      I was thinking that I could replicate your problem by marking a single document as being a "container", but that did not break it.

      I was going to say clear the cache, but if you’re getting it on some, that won’t do anything. I’m sorry, I don’t know.
        MODx and Wordpress development
        Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4
        • 16633
        • 116 Posts
        Please go here:
        http://specialareas.dreamhosters.com/

        Under "Living" you will see "Community Services & Info" has an arrow and a class of ’parent’ but does not have any children.
        Then at the bottom of "Living" you will see "Waste Management" has children, but does not have a class of ’parent’ or an arrow.

        Here is my Wayfinder call
        [[!Wayfinder? &startId=`0` &outerClass=`sf-menu` &rowTpl=`SABRowTpl` &parentClass=`parent`]]
        


        Here is my SABRowTpl
        <li[[+wf.id]] class="[[+wf.classnames]] n[[+wf.docid]]">
        	<a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]>[[+wf.linktext]]</a>
        	[[+wf.wrapper]]
        </li>
        
          --
          Landon Poburan
          Web Designer and Developer

          http://www.categorycode.ca
          http://www.landonp.com
          • 26016
          • 561 Posts
          Hmmm,
          That’s a cheval of a different colour. wink You may indeed have found a bug. Having the call and template to look at is always more helpful.

          I have one last idea before you submit the bug. It may not work, but you can try it. When I’ve wanted those classes to appear, I’ve never used "class=" before wf.classnames, Wayfinder should fill that in for you. Note the difference below:

          <li[[+wf.id]] class="[[+wf.classnames]] n[[+wf.docid]]">
          	<a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]>[[+wf.linktext]]</a>
          	[[+wf.wrapper]]
          </li>


          After taking that out:
          <li[[+wf.id]] [[+wf.classnames]] n[[+wf.docid]]">
          	<a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]>[[+wf.linktext]]</a>
          	[[+wf.wrapper]]
          </li>


          BTW, VERY slick styling on that menu... I like it. The arrow thing is really cute. And a nice hover delay is always good.

          Good luck, D
            MODx and Wordpress development
            Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            There is supposed to be two placeholders for getting classnames into an element - wf.classes, which inserts the whole class="" attribute, and wf.classnames, which only inserts the classnames, not the class="" part.
            [+wf.classes+] - where classes specifed will be inserted (includes class=" ")
            [+wf.classnames+] - outputs the just the class names (without class=" ")
              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
              • 16633
              • 116 Posts
              Quote from: sottwell at Feb 16, 2011, 01:35 PM

              There is supposed to be two placeholders for getting classnames into an element - wf.classes, which inserts the whole class="" attribute, and wf.classnames, which only inserts the classnames, not the class="" part.
              [+wf.classes+] - where classes specifed will be inserted (includes class=" ")
              [+wf.classnames+] - outputs the just the class names (without class=" ")

              Yes I know. I used wf.classnames because I needed to add a unique identifier on each li to some unique styling. So is this an official bug with Wayfinder then?
                --
                Landon Poburan
                Web Designer and Developer

                http://www.categorycode.ca
                http://www.landonp.com
                • 33997
                • 150 Posts
                What about trying to use &parentRowTpl to see if that fixes the glitch? Then you could change your Tpl (for parentRow) to read as such:
                <li[[+wf.id]] class="parent [[+wf.classnames]] n[[+wf.docid]]">
                	<a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]>[[+wf.linktext]]</a>
                	[[+wf.wrapper]]
                </li>
                

                This may help in pinpointing if there is some setting wrong in the site, or if it is a glitch in WF.
                  "Great spirits have always encountered violent opposition from mediocre minds." -Albert Einstein
                  • 22427
                  • 793 Posts
                  @samba:
                  I’ve never used "class=" before wf.classnames, Wayfinder should fill that in for you.
                  That’s wrong. This is the case for wf.classes (see sottwell’s reply).
                  <li[[+wf.id]] [[+wf.classnames]] n[[+wf.docid]]">
                  cannot be correct syntax. You see it already from the fact that you have a single " in it.
                    • 16633
                    • 116 Posts
                    Quote from: goonz at Feb 16, 2011, 08:26 PM

                    What about trying to use &parentRowTpl to see if that fixes the glitch? Then you could change your Tpl (for parentRow) to read as such:
                    <li[[+wf.id]] class="parent [[+wf.classnames]] n[[+wf.docid]]">
                    	<a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]>[[+wf.linktext]]</a>
                    	[[+wf.wrapper]]
                    </li>
                    

                    This may help in pinpointing if there is some setting wrong in the site, or if it is a glitch in WF.

                    Would I use this instead of &rowTpl or use both together?
                      --
                      Landon Poburan
                      Web Designer and Developer

                      http://www.categorycode.ca
                      http://www.landonp.com
                      • 33997
                      • 150 Posts
                      Quote from: landonpoburan at Feb 16, 2011, 03:31 PM

                      Yes I know. I used wf.classnames because I needed to add a unique identifier on each li to some unique styling. So is this an official bug with Wayfinder then?
                      You can use :
                      &rowIdPrefix - If set, this parameter creates a unique ID for each item. The value will be rowIdPrefix + docId. (from RTFM)
                      and then use:
                      [[+wf.id]] - outputs a unique id (from RTFM).

                      I don’t know if this outputs only an id or if it outputs:
                      id="uniqueID"
                      as I’ve never used it, but it appears in the example that it will output as above.
                      http://rtfm.modx.com/display/ADDON/Wayfinder
                        "Great spirits have always encountered violent opposition from mediocre minds." -Albert Einstein