We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12556
    • 103 Posts
    Hey guys. I’ve got a template with the following in it:
    [!Wayfinder? &startId=`3` &outerTpl=`projectNav` &rowTpl=`projectNavLink`!]

    The projectNav chunk contains this:
    <div id="projectNav">
    		[+wf.wrapper+]
    </div>

    The projectNavLink chunk contains this:
    <a class="project" rel="[+wf.id+]" href="javascript:;">[+wf.title+]</a>

    There is a document with an ID of 3 and it has one child.
    When I view the page, nothing is being output. I’m sure I’m screwing it up as this is my first time trying to create a template for Wayfinder but what is it I’m doing wrong?
    Dave

      • 7231
      • 4,205 Posts
      The call and chunks look correct. Is the child of (3) published and set to ’show in menu’?
        [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]
        • 12556
        • 103 Posts
        Thanks for the quick response! The problem was that I’m retarded. "Show in Menu" wasn’t checked. lol Sorry to have bothered you.
          • 12556
          • 103 Posts
          I do have another, less retarded question. How can I get an iterator in my chunk? I want each of the links to have the rel attribute set to a number starting with 0 and proceeding consecutively from there.
            • 7231
            • 4,205 Posts
            I don’t think that there is an iterator function in WF (I could be wrong). It would be nice. You can use the document ID and have numbers but they will not be in order or start at 0. You can run a snippet in the WF chunk, so if you can code a php script that will iterate you are golden.

            I think I had hacked an iteration in WF a while back as an experiment but don’t remember. I will see if I can find my notes.
              [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]
              • 12556
              • 103 Posts
              Without knowing anything about how to create a snippet I took a quick stab at it with a snippet named wfIter containing this:
              <?
              if(isset(wfIter))
              	wfIter++;
              else
              	wfIter = 0;
              	
              echo wfIter;
              ?>

              And modified my projectNavLink chunk like so:
              <a class="project" rel="[!wfIter!]" href="javascript:;">[+wf.title+]</a>

              This failed hard. It just echoed the snippet call itself in the output and didn’t execute it. How do I fix that? Will my snippet even do anything remotely like what I’m hoping it will here? Thanks!
                • 4172
                • 5,888 Posts
                perhaps you can use &rowIdPrefix=`test` together with the placeholder [+wf.id+]
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                  • 12556
                  • 103 Posts
                  I’ve actually tried using wf.id and it didn’t seem to do anything. For now I’ve managed to make it work by using wf.docid, since all the documents I’m using are in sequential order, and adjusting for the offset in my JS but I’d still like to figure out how to do this the right way in case there’s a time I need to do it and the documents are NOT consecutive.
                    • 4172
                    • 5,888 Posts
                    you need &rowIdPrefix for [+wf.id+]
                      -------------------------------

                      you can buy me a beer, if you like MIGX

                      http://webcmsolutions.de/migx.html

                      Thanks!