We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9359
    • 128 Posts
    Hi everybody,
    i have a little question:
    i have a tree like this:

    PRODUCTS----> CATEGORY1---->SUBCATEGORY1--->product-1-1, product-1-2, ....
    ----> CATEGORY2---->SUBCATEGORY2-1--->product-2-1, product-2-2, ....
    ....
    How can make a wayfinder call for get only product-1-1, product-1-2, product-2-1, product-2-2. ?



      "Destiny is not a matter of chance, it's a matter of choice"
      • 25307
      • 114 Posts
      just to clarify the question with a couple more questions smiley


      • • so, are you looking to get all child resources within specific folder(s)?
      • • in this case then you want output all children of SUBCATEGORY1 and SUBCATEGORY2 - that right? or are there other children of those that you don't want to be displayed?
      • • also, will there be other categories/subcategories/etc. down the road?

      [ed. note: robot last edited this post 15 years ago.]
        • 9359
        • 128 Posts
        yes, i want to get ALL children within specific folder...
          "Destiny is not a matter of chance, it's a matter of choice"
          • 33968
          • 863 Posts
          getResources might be a better choice:
          [[!getResources? &parents=`1,2` &tpl=`productTpl`]]
          where `1,2` are the ids of subcategories 1 and 2.

          But there was a good reason for this question:
          also, will there be other categories/subcategories/etc. down the road?
          A better solution would be possible if the products have a different template to all the other pages. That would allow you to add new categories without having to add more ids to the snippet call:
          [[!getResources? &parents=`1` &where=`{"template:=":5}` &tpl=`productTpl`]]
          

          where &parents=`1` is the id of your Products container, and 5 is the id of your product (child page) template. [ed. note: okyanet last edited this post 15 years ago.]