We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16355
    • 5 Posts
    I tried to use NewsListings two times in one Document and that leads to an error (can’t close tag).
    I can only use it once. (@startID - that does not change anything...)
      • 33337
      • 3,975 Posts
      it should be &startID not startID.

      I hope it helps,

      regards,

      zi
        Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
      • Very odd, I use it twice on the same page with no trouble (once I fixed the duplicate function definition issue), and it definitely does need to be startID:

        $resourceparent = isset($startID) ? $startID : $modx->documentIdentifier;


        If you put StartID, you’ll get it keying off the current document where the snippet is called from.
          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
          • 16355
          • 5 Posts
          Hi sottwell,
          I don’t really understand what to do with your Code ($resourceparent = isset($startID) ? $startID : $modx->documentIdentifier;)?
          I found the exactly the same code at the beginning of the NewsListing snippet.
          But how have you fixed it?
          Thanks,
          kriti
            • 33337
            • 3,975 Posts
            She wrote some explanation to the code actually smiley

            regards,

            zi
              Zaigham R - MODX Professional | Skype | Email | Twitter

              Digging the interwebs for #MODX gems and bringing it to you. modx.link
              • 9583
              • 25 Posts
              Was the "ListIndexer" snippet included with the base install? I seem to remember that it was, and I thought I remembered a forum post about it, but I could only find a question I had, and some French I couldn’t read. smiley

              It was an Etomite snippet that let you build a list of links using multiple folders and their children as the content, and it let you sort by date or title, and it had a bunch of other flexible features. Mainly intended to build an index page. I have hacked at it to make a crude combination of that and NewsListing, but it’s nowhere near prime-time, and it’s loaded with hardcoded extras that I wanted for my site.

              Anyway, that may be a place to start; look in your snippet collection to see if it’s there.
                • 18397
                • 3,250 Posts
                Thanks for reminding us of that snippet! I was researching how to do the subdirectories and had just about written the exact same thing Jared did when you mentioned this. For reliabilities sake I might just use his code (there haven’t been problems with it) if its ok with him. (Is it Jared?)
                  • 13577
                  • 302 Posts
                  That’s got to be my favorite snippet ever. I’ve used that for more stuff than I should prolly admit. smiley

                  From my use, it’s been very stable. I ramped through 10 versions (up to the existing version 0.6j) in pretty quick order, but I haven’t had any support issues pop up since August. So it seems to be working well for others too.

                  As always, I’m tremendously honored when my code is used. Have at it.
                    Standard Disclaimer
                    I could be totally wrong.