We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 50538
    • 8 Posts
    Hey, I want to make a universal template which will show contents of parent document. Something like:
    [[$header_h_1]]
       
        [[!getPage@Paginator?
          &elementClass=`modSnippet`
          &element=`getResources`
          &showHidden=`1`
          &tpl=`get_resources_tpl`
          &pageLimit=`3`
          &limit=`15`
          &includeContent=`1`
          &includeTVs=`1`
          &processTVs=`1`
          &parents=`2`
          &hideContainers=`1`]]

    If i hardcore parent
    &parents=`2`
    all okey, but I don't want to make own template for all documents. Is there any way to get dynamic id? If i change to
     &parents=`[[*parent]]`
    I get list of all documents. A bit confuesed to be honest.
      • 4172
      • 5,888 Posts
      I think, what you want is the UltimateParent - snippet
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 50538
        • 8 Posts
        Quote from: Bruno17 at Aug 02, 2016, 10:35 AM
        I think, what you want is the UltimateParent - snippet
        Omg, why such common operations in ModX like pagination, id of parent is so difficult to make? Thanks for advice - I'll try it.
          • 4172
          • 5,888 Posts
          if you really want to list all siblings (and its children) of the current resource

          &parents=`[[*parent]]`


          should just work
          you can also define a &depth, if you don't want the children.

          If you want the children of the current resource, you would use

          &parents=`[[*id]]`


          but if you want the children of a parent at a specific level in the tree, no matter how deep you are with the current resource, you will need something, which can get the id of a resource at a specific level. This is, what UltimateParent is good for.
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!