We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24676
    • 60 Posts
    Let me try and explain my issue.

    I am using get resources to pull in latest blog posts (articles) to my home page. I am limiting these two just the latest two.

    I also have a members area on the site. Some of the blog posts will be for members only so wont appear on the home page, but only within the members area. I have added these posts into my resource group for members.

    The issue I am having is that getResources seems to still count these in my limit even though it doesn't show them. For example, if my latest two posts are both for members only it wont show anything on the home page, it doesn't seem to skip them and show the latest two posts that are not in a specific resource group.

    Does anyone have an idea as to how to solve this?

      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Try it using pdoResources instead. I'm not sure if it will have the same sequence of processing or not.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        You could also use a getPage wrapper, having the getResources properties fetch more, but the getPage only displays two. If you don't have the prev/next buttons in the getPage tpl, then it won't be obvious that's what you have done.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 24676
          • 60 Posts
          Thanks Susan - Seems like a good work around. I will give it a go.
            • 4172
            • 5,888 Posts
            if that doesn't work, try to exclude that private resources with

            &resources=`-5,-10,15`


            you could create a little helper-snippet, which does create the exclude-list dynamically.

            As far, as I can remember, the issue here is, getResources filters the resources with missing access-permissions after fetching the limited resources.

              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!