We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33982 ☆ A M B ☆
    • 476 Posts
    Running MODx 2.2.4-pl with Articles 1.6.1 and getResources 1.5.0

    Upon setting up Articles, I imported a WXR file from a WP site where I had exported the postings in this file format. Everything imported into MODx Articles just fine...no problem. The Articles I had imported from WP showed up perfectly on the MODx site using getResources call on other pages in the site.

    So I started adding in new Articles by adding them in MODx and they will not show up...only the ones that were imported previously from WP.

    Here's my getResources call:

    [[!getResources? &parents=`27` &tpl=`blog_category_listing_tpl`]]


    Just using getResources, all the Articles that had imported from WP show up using this call just fine. But none of the new Articles created in MODx even though they're all set to published.

    I can load the new MODx Articles by their MODx Resource ID. For example, a newly created Article in MODx with ID 122 will load via the URL (i.e. www.site-name-url.com/index.php?id=122).

    Also worth noting, if I call to that specific Resource, it will load:

    [[!getResources? &parents=`-1` &resources=`122` &tpl=`blog_category_listing_tpl`]]


    Not sure if this is a known issue or or not. Any help/insight would be greatly appreciated. Thanks! [ed. note: flinx777 last edited this post 14 years, 4 months ago.]
      Precision Web Development ... SmashStack.com
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      Articles are by default set to be hidden from menu's, which means it doesn't show up by default when using that first getResources call. I'm going to guess that there's a bug in the wordpress import utility that it doesn't properly hide the items from the menu on import for those items.

      Using the second getResources call, I assume the ID takes precedence and it includes it anyway.

      Conveniently, I wrote an article about back in February: http://www.markhamstra.com/modx-blog/2012/2/listing-articles-posts-getresources-wayfinder/ - may also want to see what is mentioned in the RTFM for Retrieving Articles outside of Articles.

      (TL;DR: add &showHidden=`1` to your getResources calls)

      And uhm. Be sure to cache to getResources call too, no reason to waste precious performance by having them uncached. Read my Caching Guidelines if you don't know when to cache/uncache.

      Sure am plugging my own blog a lot this Friday evening. Lol.
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 33982 ☆ A M B ☆
        • 476 Posts
        Wow...the &showHidden=`1` did the trick. Thought I was about to loose my mind there for a second. Will review your blog.

        Again, thank you so much!
          Precision Web Development ... SmashStack.com