We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 35985
    • 33 Posts
    I am struggling with getting getresource to play nice with article. It would be simple if there is a way to get getresource to start at a specified depth.

    My situation: I have blog section with three folders/documents to use getresource to display the latest contents posted. Also with the homepage calling the recent articles posted anywhere. With in each folder/document, I have my article containers. Everything work fine to that point but everytime I add a new article container it show up in my get resource call as its own entity. Ex. adding article container called "subject", then i publish 2 articles. Getresources pulls the 2 articles(as it should) but also an entry called "subject". subject naturally has no text content and appears empty as the article container should be.

    I suppose this is possible to work through as the article get populated, but everytime a new article container is made i get this blank entry. I am sure I can call just the containers that exist but would have to add the ID every time I add a new container which may be on a regular basis.

    Is there a GetResource parameter to deal with this, a Depth start? Or is there another work around that I am not seeing here?

    Thanks again in advance!

      [[!getResources? &showHidden=`1` &parents=`27,7,28` &tpl=`articleTpl` &includeContent=`1` &includeTVs=`1` &processTVs=`1`]]
    for those who want to see the getresource call. It works fine but also pulls the article container when newly created.

    Cheers!

    This question has been answered by multiple community members. See the first response.

    [ed. note: Shopcoop last edited this post 14 years, 7 months ago.]
    • discuss.answer
      • 22019
      • 390 Posts
      hideContainers=`1`
      should do it.

        Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
      • discuss.answer
        • 35985
        • 33 Posts
        THANK YOU! That did the Trick! I had a feeling its was something simple. Gazed right over this in the documentation.

        NOTE: To anyone trying to do the same thing, it is important that you go into the settings tab and tick "Container" box for this to work properly.

        MODX Community Strikes again! tongue