We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18397
    • 3,250 Posts
    NewsArchive V1.5
    Snippet written by Mark Kaplan at the end of October 2005
    Last updated, November 2nd 2005.

    Displays an archive of posts with full support for pagination (paging of content in increments).

    NOTE: Always call uncached via the [!NewsArchive!] format

    Readme:

    /*
    * NewsArchive by Mark Kaplan (October 2005)
    * Displays an archive of posts with full support for pagination (paging of content in increments)
    *
    * Version 1.5
    *
    * Updates:
    * October 30th 2005 - 1 - FURL detection and support added.
    * October 30th 2005 - 2 - Increment support added.
    * November 1st 2005 - 3 - Trunctuate variable now defaults to false.
    * November 2nd 2005 - 4 - Multicall support added.
    * November 2nd 2005 - 5 - Trunctuate option bug fixed.
    *
    * Based on NewsListing
    *
    * Always call uncached like so: [!NewsArchive!]
    *
    * Use the following placeholders for locating the prev/next buttons and other info
    * [+buttons+] - the previous/next text links
    * [+start+] - the # of the first item shown
    * [+limit+] - the # of the last item shown
    * [+resourcecount+] - the total # of items
    *
    * Example:
    *
    * Showing <strong>[+start+]</strong> - <strong>[+limit+]</strong> of <strong>[+resourcecount+]</strong>
    [+buttons+]
    *
    * Snippet parameters [default] :
    * &startID - the folder containing the posts [the document called from]
    * &total - max number of posts to retrieve [100]
    *
    * &increment - # of items to advance by each time the previous or next links are clicked [10]
    * &trunc - truncate to summary posts? if set to false, shows entire post [true]
    * &truncSplit - use the special "splitter" format to truncate for summary posts [true]
    * &truncAt - the split-point splitter itself [<!-- splitter -->]
    * &truncText - text for the summary "show more" link
    *
    *
    * &tpl - name of the chunk to use for the summary view template
    * &dateformat - the format for the summary date (see http://php.net/strftime ) [%d-%b-%y %H:%M]
    * &pubOnly - only show Published posts [true]
    * &emptytext - text to use when no news items are found
    * &commentschunk - if you’re using comments, the name of the chunk used to format them
    *
    */
      • 33337
      • 3,975 Posts
      Cool snippet ! smiley

      Thanks for sharing !

      regards,

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

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
        • 18397
        • 3,250 Posts
        Code updated with:


        - 1 - FURL detection and support added.
        - 2 - Increment support added
          • 18397
          • 3,250 Posts
          Question: Should this code be merged with NewsListing so that it can be called as [!NewsListing&archivemode=1!] or should it remain as a separate snippet?
          • I tend to thing this should be merged in. I also tend to think we should do an Archive where it can be done annually by month. Perhaps we could use this as an archive plugin-like snippet by calling the appropriate snippet via the API call.
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • Oh, and very cool stuff smiley
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 18397
                • 3,250 Posts
                Version updated
                  • 33337
                  • 3,975 Posts
                  Are multiple calls on same page supported ?
                    Zaigham R - MODX Professional | Skype | Email | Twitter

                    Digging the interwebs for #MODX gems and bringing it to you. modx.link
                    • 18397
                    • 3,250 Posts
                    Yes, version 1.4 does.
                      • 33337
                      • 3,975 Posts
                      Thank you Mark smiley

                      How about updating the first post too ?

                      regards,

                      zi

                      [EDIT]: It is rendering word " Array " after summary ? what is that ?
                        Zaigham R - MODX Professional | Skype | Email | Twitter

                        Digging the interwebs for #MODX gems and bringing it to you. modx.link