I've been developing a revision of Cookbook:BlogSimple that differs in the following ways:

  1. Automatic archive pages (using default text and pagelists)
  2. Blog posts can exist in any group
  3. Post title can be anything, no date necessary

In this model, posts can appear anywhere, and simply must contain the [[!Blog]] category (or this can be changed). The archive pages are created by changing the default text within the BlogArchive group to automatically show a list of posts that match the title of the page... so BlogArchive/2006-06 would list posts from June 2006.

In order to accomplish this recipe as described above, I did the following:

  1. Removed a few variables and added several other ones. The following is a list of variables added using blogsimple2.php:
    • {$Today}, which gives you today's date formatted like 2017-04-25
    • {$TodaySimple}, which gives you today's date formatted like Tuesday 25 April
    • {$BlogDate}, which is the page creation date like 06 June 2006
    • {$BlogDate2}, which is the page creation date like 2006-06-06
      • This one works great for sorting purposes in pagelists by creation date.
    • {$BlogMonth}, which takes a page name beginning with yyyydd and formats it into something readable as in February 2006
      • Used to reformat archive page names into a readable title
    • {$BlogMonth2}, which is another form of the page creation date shown like 2006-06
      • Used for sorting, as the year comes first; also used for the archive pages
    • {$BlogMonth3}, which is another form of the page creation date shown like June 2006
      • For a list of posts but showing only the month and year
    • {$LastModifiedDate}, as in Wed 07 Jun
    • {$BaseName}, which extracts page names from PostComments group to allow for linkage between the post and its comments page, as described in Cookbook:CommentPageLink
  2. Enabled Cookbook:AllGroupHeader and footer (as Site.SiteHeader and SiteFooter) in order to automatically show the comment box on all footer pages. It automatically avoids this in the $DefaultGroup and $SiteGroup and BlogArchive. In order to avoid this showing up on another group, you simply have to create a page called /GroupFooter.
  3. Created a new default text for the BlogArchive group that shows a pagelist of every post that matches the name of the month, which needs to be in yyyymm form (derived from {$BlogDate2}.
  4. Added Site.BlogListTemplates as a default pagelist page by using the new $FPLTemplatePageFmt, and created several new pagelist templates, as can be found there.
  5. Created pages:
    • BlogArchive: this page is created on the fly using two pagelists: one that shows all posts in date order, the other showing only the year and months used.

This recipe requires far more initial work than Cookbook:BlogSimple for one main reason: since the blog doesn't specifically exist in any one place, you are required to place the pagelists wherever you want them. So you decide where you'd like, for example, the pagelist showing complete blog posts to be placed, and then put the pagelist on that page manually. This also makes BlogSimple2 skin-blind, since I haven't set up any menus. One thing to note is that if you put this recipe in config.php, it's fairly invasive; but if you want it to be confined to a few groups, this is possible as well by using local configuration files.

All you need to do to create a new post is create a page somewhere and add the category link to Blog, as in [[!Blog]]. If you don't want this to show on your posts, you could do %comment%[[!Blog]]%%. If you want to use another category name, you'll need to change the default text for the archives page because it builds the pagelist from link=Category.Blog (and you'll have to change any other pagelists you have as well, obviously--but this is the only one that's hardcoded into blogsimple2.php).

I didn't specifically add any category function to this recipe. I tend to either use the built-in category capabilities of PmWiki or Cookbook:Tags and I think most functions can be accomplished using these two possibilities, but I'm open to suggestions and/or further tweaking.

Creative Commons License

Welcome to JonHaupt.net; it's my blog, as you might have gathered. I write about food, photos, and other things.

The blog looks best using Chrome, Firefox, Safari, or WebKit. If you use IE or something, and it doesn't look as good, sorry.

JonHaupt.net is powered by PmWiki.