We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30497
    • 245 Posts
    Hello,

    Perhaps someone can help me. smiley

    I need to create an article index that updates automatically when a new article is added.

    I have a parent document file - "articles" - and ~20 different documents under that parent. What I want is that the "articles" page will have a vertical list of all the articles that are stored under it, and that will update automatically when one of the content writers adds an article.

    How should I best approach this? I considered the existing snippets "ListIndexer" and "Wayfinder", but before I get too lost in php I don’t understand well yet (just learning), I thought I’d ask for some community advice.

    Thank You.
      • 3749
      • 24,544 Posts
      If all you want is a list of the documents’ titles, Wayfinder is probably the easiest way to go. In fact, the minimal Wayfinder call should give you a list of the menu titles.

      If you want to show a summary or excerpt of the article or any information about it such a author, publication date, etc., then you want Ditto rather than Wayfinder. You can always switch later if you change your mind.
        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
        • 7231
        • 4,205 Posts
        The thing to consider is the sort order, if you sort by date (if you are using Ditto that is) the newest will be first if you sort order is DESC that is. I would recommend Ditto since it is geared towards this sort of feature while WayFinder is more geared towards menu building (but both can do so much more). Can’t go wrong.

        Listindexer is outdated I think, wasn’t it replaced by Ditto.
          [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

          Something is happening here, but you don't know what it is.
          Do you, Mr. Jones? - [bob dylan]
          • 34162
          • 1 Posts
          I have a site on which I use Wayfinder frequently to generate several ’indexes’.

          It’s very easy and works perfectly smiley
            • 30497
            • 245 Posts
            Ok thanks. I guess Wayfinder then, as I don’t really need abstracts from the texts or anything, just to have the longtitle or title link to the article.

            How do I ensure that the index is created only from articles that are put under the "articles" parent document?

            Thanks.
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Use the ID of the article parent document as the startId parameter for the Wayfinder snippet.
                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
                • 30497
                • 245 Posts
                Quote from: sottwell at Mar 29, 2008, 06:57 AM

                Use the ID of the article parent document as the startId parameter for the Wayfinder snippet.

                great, so the ID of the parent as the start parameter ensures that all children of the parent are listed, regardless of their own ID, correct? I’ll check it out.

                Thanks.
                  • 21723
                  • 8 Posts
                  I’d like to do this same thing with articles coming from 2 different containers. How is that possible? I’d like articles about one subject to show and then a general listing of all new articles no matter what container they are in. Thanks.

                  Kyle