We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 965
    • 3 Posts
    Quote from: OpenGeek at Mar 12, 2011, 09:16 AM

    Quote from: alexbaxter at Mar 12, 2011, 06:32 AM

    Quote from: OpenGeek at Mar 11, 2011, 08:22 AM

    You have to change pageNavVar, as suggested.
    No effect... Problem is not resolved. Have others proposal?
    Well, what is the problem? There are folks that have gotten multiple instances to work, so I’m not sure what problems you are having. Have you tried using the namespace?
    My problem was described here

    I want show 2 posts on one page:
    1 last post from parents ’32’ and
    1 last post from parents ’10’
    by using getResoures+getPage with different tpl...

    Can you show me example of a correct call two or more instance of getPage on one page for different parents?

    p.s. resolved. so, solution is using &cache=`0` on every call of getPage.
      • 30319
      • 406 Posts
      Where is the pageNavVar mentioned in this thread??
      What is an appropriate value for pageNavVar??
      Thank you, Tom
        • 22303 MODX Staff
        • 10,725 Posts
        Quote from: alexbaxter at Mar 14, 2011, 05:17 AM

        I want show 2 posts on one page:
        1 last post from parents ’32’ and
        1 last post from parents ’10’
        by using getResoures+getPage with different tpl...
        I’m not sure why you would ever use getPage unless you need to present more than 10 or 20 resources on more than one page. If you are just showing one post from each getResources call, why do you need paging at all?
          • 22303 MODX Staff
          • 10,725 Posts
          Quote from: TomMLS at Apr 25, 2011, 12:23 PM

          Where is the pageNavVar mentioned in this thread??
          What is an appropriate value for pageNavVar??
          Thank you, Tom
          Whatever you want the placeholder to be for the paging navigation created for a specific instance of getPage (when you have multiple running per page).
            • 36502 ☆ A M B ☆
            • 491 Posts
            Hi, I have the same problem:

            2 instances in the same page:
            1. [[!GetResources?parents=`4` &tpl=`one` ...]]
            2. [[!GetResources?resources=`12,43,76,43` &tpl=`two` ...]]
            


            the second one still takes documents from parents=`4`...
            may be there is some problem with cache? [ed. note: tillilab last edited this post 15 years ago.]
              TilliLab | MODX Ambassador
              website
              • 36502 ☆ A M B ☆
              • 491 Posts
              update...
              it seems that the second call just ignores the parameter "resources",
              If I change the second call with:

              2. [[!GetResources?parents=`234` &tpl=`two` ...]


              it correctly gets documents from parent 234... [ed. note: tillilab last edited this post 15 years ago.]
                TilliLab | MODX Ambassador
                website
                • 22303 MODX Staff
                • 10,725 Posts
                It's not ignoring the resources parameter, but it is assuming parents to be the current Resource on which getResources is executing, as well. If you ONLY want the resources, set parents to -1 in the second call.
                  • 36502 ☆ A M B ☆
                  • 491 Posts
                  Thanks! It works perfectly!
                    TilliLab | MODX Ambassador
                    website
                    • 14822
                    • 61 Posts
                    Quote from: opengeek at Oct 14, 2011, 09:39 AM
                    It's not ignoring the resources parameter, but it is assuming parents to be the current Resource on which getResources is executing, as well. If you ONLY want the resources, set parents to -1 in the second call.

                    Thank you very much, you put me off a big headache smiley
                      • 38090
                      • 53 Posts
                      I had a similar issue with running getresources to get a single pages information. Using this:
                      [[!getResources? &resources=`[[*rightCTA]]` &tpl=`tpl.content` &limit=`1` &depth=`0` &includeContent=`1` &first=`0` &sortdir=`ASC` ]]

                      solved the problem.

                      The issue was that getResources was returning all of the child resources of the page that I was currently on. The above line makes sure that the page I'm on is at the top of the result set and that no more that 1 result set is returned. A little bit of a hack, but it works.