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

    I’m trying to include the output from a snippet (getField) in my Wayfinder template chunks. I haven’t read anything on why this *shouldn’t* work, but yet, it doesn’t seem to.

    My Wayfinder call:

    [!Wayfinder? &startId=`21` &level=`2` &outerTpl=`outerTpl` &innerTpl=`innerTpl` &rowTpl=`rowTpl` &innerRowTpl=`innerRowTpl` &hideSubMenus=`1`!]



    My innerTpl (where I’m trying to include the snippet/chunk):

    <div class="subnav">
    <p class="parent_menu">
    [! getField? &docid=`[*parent*]` &field=`pagetitle` !]
    </p>
         [+wf.wrapper+]
    </div> 


    That doesn’t work. Instead of showing the returned value of the snippet, it instead shows the entire snippet call (that is, it prints on my screen "[! getField?"... and all the rest).

    If I instead place the above snippet call in a chunk, and call the chunk instead (so, innerTpl calls ChunkA, which in turn called getField), and get the same behavior. The actual text of the snippet appears on the webpage.


    You’ll notice both the Wayfinder call and the snippet call are uncached.

    If I change it so that Wayfinder is not cached, but the snippet is cached, I get absolutely nothing. The snippet is not processed, printed, etc: the area where it should be processed, is blank on the webpage.

    If I change it so that Wayfinder is cached, but the snippet is not cached, I get also just a blank area.

    If I change it so that both of them are cached, I still get a blank area.
      • 15029
      • 35 Posts
      Have you found a solution?
      I’m also trying to insert a snippet inside a Wayfinder template chunk and wondering if this is feasible.
        • 32038
        • 26 Posts
        I am wondering if this is possible as well as I’ve been banging my head trying to figure this out.

        Within my rowTpl, I have a snippet that other wise works outside of calling it within this wayfinder call. I believe it has to do with calling it with parameters as I can create a tmp snippet returning a hard coded value and it works as expected.

        My wayfinder is called "[!Wayfinder? ... !]

        And my internal called snippet is "[[get_my_value? &param1=`foo` &param2=`bar`]]" though just to make sure have called it as "[!get_my_value? &param1=`foo` &param2=`bar`!]" as well.

        Any thouoghts?
          • 4172
          • 5,888 Posts
          if you have a uncached wayfinder-call
          [!Wayfinder? ... !]


          you need a cached snippet-call in its chunk:
          [[get_my_value? &param1=`foo` &param2=`bar`]]

          can you show us your real parameters, which you have there?
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 32038
            • 26 Posts
            Code within chunk...

            [[get_image? &tvImageName=`[+menu_image+]` &tvImageDocID=`[+wf.docid+]`]]
            


            Wayfinder call...

            [!Wayfinder?  &level=`1` &hideSubMenus=`TRUE` &outerTpl=`category-outer-container` &outerClass=`category-nav` &rowTpl=`category-nav-item`!]
            



              • 32038
              • 26 Posts
              Sorry for the noise... I feel like a total (insert word here).

              I actually needed to pass in a value, not the TV into my code. Not sure how I did that. I can’t even blame copy/paste on this one.

              Anyways... my issue is solved and is working.