We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14557
    • 48 Posts
    Has anyone set up a blog archive using ModX? What I want is to auto-create a list of links to each month that I have blog entries for, and an ablity to display just the entries for the appropriate month (e.g. using Ditto). How did you do it?

    One more question related to the above - can I have the month and date embedded in the file path of the alias of each entry - e.g. www.mysite.com/2006/08/11 being today’s entry, whereas mysite.com/2006/08 might show you all pages for this month. Any ideas on how I might do it? I think its a pretty standard blogging feature.

    Cheers

    John
    • I don’t think that’s easily doable unless you want a lot of manual work and to use friendly alias paths. You could theoretically hack one of the front end publishing snippets to create the appropriate folder structure automatically I suppose though.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 27226
        • 186 Posts
        Mmmm. Your question leads me to the assumption that the blog-functionality is the main if not the only way you present your content?
        If so, you could provide params for ordering/displaying based on the "last edited" field of the MODx database and if 2006/08 (for instance) is requested as an url, you’ll get a 404. If you could catch this and redirect it to something a snippet provides, you may come along.
        Interesting question, though, and I’m not the right one to provide an answer. Just my 0.01.
          • 14557
          • 48 Posts
          Thanks for the suggestions - I’ll have a look at catching the 404 and redirecting to a snippet (perhaps a tweaked ditto). Another idea I had would be to approach it slightly differently and put the date in a querystring which a snippet would use to filter - not quite as nice a URL though.

          I’m actually trying to integrate a blog as just part of an information website (http://www.specialfamilies.org). So using a blog tool such as Wordpress did not seem to be a good idea and for everything else I reckon I can’t do better than ModX.

          I reckon a database query to pull out the distinct list of months for the archive could be combined with a modified Ditto snippet to display just that month’s articles would be quite easy. I’ll just need to find myself a couple of hours to do it! The date based folder structure will have to wait I think.

          John
            • 18397
            • 3,250 Posts
            You can manually create the month pages in the archive and use a Ditto filter or custom where statement to only show that months dates.