12

Oct

Really simple CMS with a Blogger back end

Posted by stuart as

So I’ve got this mate, right, who’s a pastor at a Baptist Church.Currently, he runs a Blogger blog as his church website, which as a part time web developer, is something I think no bloke should let his mate do.

So what to do?

This mate of mine wouldn’t know a hyperlink from a hole in the ground, and is happy with his knowlege of the Blogger interface, so a CMS is pretty much out of the question.

I could try to work out how to make a template for blogger, but quite frankly, couldn’t be arsed. Most of the work I do in my part time “day job” is re-creating photoshop templates with HTML and CSS. This is what I’m comfortable with, along with a little PHP.

So I get to thinking; How can I integrate his knowlege of Blogger, my knowlege of HTML and a bit of PHP, and come up with a site he can maintain.

I know I could put together a site for him, and get hold of something like Macromedia Contribute, or Interspire’s WebEdit (which some of my clients use), but then he’d have to learn a whole new interface and all that, which he’s not really interested in doing.

Then, like a thunderbolt from the ass of my four year old son, it struck me.

FEEDS

Blogger, of course, publishes its blogs as feeds. What a lot of people might not realise, is that it also publishes feeds of categories (or labels, as blogger calls them - WTF??), you just need to know where to look. (more on this in a little while.)

The ingredients we’ll need to create our SSBDCMS (Super Simple Blogger Driven Content Management System) are as follows:

  1.  A webserver that allows you to use PHP
  2. A static site with a few pages
  3. A Blogger blog (Yes, you could do this with Wordpress or any other blogging platform which outputs RSS feeds, but I’m sticking with blogger here because that’s what my mate uses)
  4. An RSS Parser (I use CARP, you could use Magpie RSS, or brew up something yourself if you’re that way inclined.)

So assuming that you have the server with PHP sorted, the first step in creating our SSBDCMS is to create the static site. In the case of the job at hand, a nice, simple, seven page site, with a hole in each page where the content goes.

Done that? Good, now on to the blogger blog.

Go set yourself up a blog on Blogger. This shouldn’t take more than about 1 minute. Don’t worry about getting a cool name, it’s completely irrelevant to this exercise, as no-one other than the person updating the site will ever see it.

Now, for each of the pages in the static site you created earlier, create a post in your Blogger blog. It doesn’t matter what you write in the post, we’re just doing this so you can set up your labels (or categories if you’re using any other platform). Save each of these pages under a label corresponding to a page on your static site.  An example:

  • Home page in the static site ===  Post with the label “home” in your Blogger blog.
  • etc. etc.

OK, so now we have a label/category in our Blogger blog corresponding to each page on our static site. Next, we need to go find the RSS feeds for each label/category in our Blogger blog so we can include them in our static site.

The URL for the feed for a particular label in your Blogger blog will look something like this:

  • http://YOURBLOGNAME.blogspot.com/feeds/posts/default/-/YOURLABEL/

Leave the /-/ there. It’s meant to be there, and obviously replace the bits in bold with your details. (Actually, the above URL will give you an ATOM feed, but meh… It will still work fine for what we want to do with it.)

If you punch the above URL into your web browser or feed reader, you should see the feed for that particular label/category of your particular blog.

Not there? You did something wrong, perform ten minutes of self flagellation (look it up), then go back and try to work out where you cocked it up.

One last thing - we need to set our blogger blog to syndicate full articles. To do this, go to your blog’s admin page, click settings -> site feed,  then choose “full”, in the “allow site feeds” option.
So, we have our static site, and we have our blog with the labels/categories and feeds all set up. Now we need to set the mood lighting, play some soft music, and hope they’ll make sweet sweet love to produce our finished product.

For this we’re going to call on our RSS parser to get the job done. Think of the parser as the character Hitch, played by Will Smith in the movie of the same name. It’s the parser’s job to facilitate the sweet love to get the content from the Blogger blog into our static site.

I’m not going to show you step by step how to do this, it will depend on the RSS parser you’re using, but I will tell you what you need to get your RSS parser to do.

In effect, in each page of the static site, we want the parser to pull in the content from the feed of each  label/category, into the corresponding page of the site. A couple of housekeeping things here:

  1. You want your RSS parser to “unlink” your headings from the actual blog. By this I mean that when your parser pulls a feed into a page, we don’t want the heading of the feed linking back to the blog as is usually the case with feeds. Remember, we’re using Blogger as a back end. No site visitor will be aware that Blogger even plays a part in this little concoction. It’s probably better still to just get your parser to not display headings at all, you don’t really need them here
  2. You also want your parser to pull one article only (unless you specifically want more articles to appear) into your page. Remember, this is a website, not a blog, so we only want the most current information. We don’t need archives in the sense that a blog has them.

OK, once we have static pages in the site pulling content from our Blogger blog, it’s time to crank out some content for the site. Go slap some content into the blog, making sure that you assign the right content to the right label/category.

Once you have the content on your site, you can sit pretty in the knowlege that you now have a  Super Simple Blogger Driven Content Management System. Updating the content is now as simple as creating a new post with your new content for the required page, in the corresponding label/category in your Blogger blog.

Who said you need to be a smart coder or spend a lot of money to create a CMS that even an idiot can use?

3 comments so far

Great write up with very interesting information

This is a great piece. Thank you for sharing this information. If you don’t mind, I will also share this to my friends who are into the mortgage refinancing business.

nice article, thanks for sharing! a CMS always helps,

Leave a Comment:

Name (required)
Mail (will not be published) (required)
Website
Message