We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40088
    • 708 Posts
    This last revision fixed the blank page issue but the picker is empty.
      Todd
      • 3749
      • 24,544 Posts
      Make sure the resource you set as the parent has children that are published and are folders. I just tested it in NewsPublisher and it's working fine for me:

      [[!NewsPublisher
          &parents=`[[getParents? &parent=`38`]]`
          &parentid=`313`
      ]]
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 40088
        • 708 Posts
        Hmmm, I'm definitely missing something.

        For me, id 2 is the parent that contains everything I need returned. Both it and all the child containers are indeed published.

        &parentIds=`[[getParents? parent=`2`]]`
        &parentid=`2`
          Todd
          • 3749
          • 24,544 Posts
          Try putting a & in front of the parent property. wink

          &parentIds=`[[getParents? &parent=`2`]]`
          &parentid=`2`
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 40088
            • 708 Posts
            Someone must have it in for me ... the picker is still empty.

            I'll have to add this to the list of things to revisit.

            Thanks, Bob.
              Todd
              • 36192 ☆ A M B ☆
              • 55 Posts
              Hi Bob,

              I'm struggling with the parentid param here as well. I would like to dynamically set the parentid based on a url param and am using the fastField extra to grab a value from the URL. Simple enough. I have the NewsPublisher snippet call in a chunk (so that the RTE doesn't bung things up). The chunk with the NewsPublisher call looks like this:

              Case ID: [[!+caseId]]
              [[!NewsPublisher? 
                  &show=`StartDate,pagetitle`
                  &initdatepicker=`1` 
                  &required=`StartDate,pagetitle` 
                  &templateid=`4` 
                  &parentid=`[[!+caseId]]`
                  &cssfile=`0`
                  &published=`1`]]
              


              Where +caseId is passed as an argument of the chunk like so:
              [[!$npNewCase? &caseId=`[[!#get.case]]`]]


              The page outputs the case id at the top, e.g. ("Case ID: 34") but the new resource doesn't appear under the resource with ID 34.

              Do I understand correctly from another post that NewsPublisher requires a static int value for parentid? Shouldn't the parser parse my [[!+caseId]] placeholder? Am I missing something?

              This post states the same issue, but I don't understand the op's solution.
              https://forums.modx.com/thread/85353/set-newspublisher-parentid-value-with-geturlparam

              [ed. note: tonkatrucker last edited this post 11 years ago.]
                • 3749
                • 24,544 Posts
                Try this in the property:

                 &parentid=`[[+caseId]]`


                Calling the placeholder uncached here delays its processing, so it's probably not available when the NP tag is parsed. Since you're setting it earlier with an uncached call, it should be a fresh value. You do have the code that sets the placeholder above the NP tag, right?

                It's fine if the ID is in a string. All snippet properties come in as strings.
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 36192 ☆ A M B ☆
                  • 55 Posts
                  Bob,

                  Calling the placeholder cached as you suggested worked like a charm. I got a little slap-happy with the uncached calls- never a good idea without good reason! Thanks for your help, and for the quick response, and moreover:

                  Thanks for putting together the NewsPublisher extra- it's saved me hours of development time.

                  Quote from: BobRay at Oct 09, 2015, 11:17 PM
                  Try this in the property:

                   &parentid=`[[+caseId]]`


                  Calling the placeholder uncached here delays its processing, so it's probably not available when the NP tag is parsed. Since you're setting it earlier with an uncached call, it should be a fresh value. You do have the code that sets the placeholder above the NP tag, right?

                  It's fine if the ID is in a string. All snippet properties come in as strings.
                    • 3749
                    • 24,544 Posts
                    I'm glad that worked. Thanks for reporting back. smiley
                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting