Would you like a blog with that?

Many websites need some sort of blog or blog-like news section these days. It may not be the main focus of the site, but it’s often there in the background with news updates and announcements. (A bit like this blog, really!)

Perch can handle that sort of content, with multiple-item regions and a bit of perch_content_custom() thrown in for good measure, but as lots of content is added over time it can start becoming a bit unwieldy. It works, but it’s not super convenient. So we decided to make good use of the new API and write a Blog app.

The Blog app adds a new link to the top of your Perch admin pages, next to Content. Posts can be added and edited, and stored in categories. The categories are all configurable, and a post can belong to one or many categories, or none at all. Posts can be tagged if you wish, and an excerpt is available for listing pages.

Once you’ve added some posts, you can drop in a perch_blog_recent_posts() tag to get back the list. You can just grab one post for your homepage, or many for a listing page. You can have an RSS feed, or grab back a list of articles from a given month, or category or tag.

Basically, it’s just a simple way to add a basic blog to a site, for those sites where the blog isn’t the main focus.

We deliberately decided not to include blog comments in this initial version of the app. Comments open a can of worms when it comes to moderation, spam prevention, and securing your site from malicious content. What’s more, many small blogs don’t even use comments, so we decided to ship without them. If you would like comments on your posts, we’ve put together Adding comments to a page or blog post over in our Solutions section.