OEIC

Wordpress as a CMS

Wordpress is generally thought of as a blogging package, but it can be easily extended to host more complex types of content, becoming a content management system (CMS) of sorts. There are a lot of CMSs available, ranging from the enterprise cost/complexity like Interwoven, Vignette and IBM’s offerings to open source like Drupal. The strength of most of these systems is in taking a wide variety of information authored by a wide array of users and pigeonholing that information into some category so that it can be easily (in theory) found by other people. However, they tend to have very complex interfaces to support all the edge use cases that have been suggested, and take training and/or time to get up to speed with. Essentially, there’s just too much overhead for a small organization looking to use the web to publish or collaborate. Alternatively, there are hosted systems like PublicSquare and Squarespace which are simpler to use, and charge a monthly fee. These services are pretty compelling, and look to be an ideal fit for a lot of organizations. The only downside is control: ultimately use policy is set by the service provider, so you might run into a wall at some point, where you simply aren’t allowed to do what you want to do with the service.

This is where Wordpress fills a niche. It’s free (though hosting generally isn’t) so it competes well against the hosted services, it’s easy to use from the base install and its extensible too. In particular, let’s look at Pages and Page Templates as a mechanism for using Wordpress as a CMS.

Probably the most common issue that people have with Wordpress is that they want a custom front page when a user browses to their site, but they want a blog too. Wordpress (as of release 2.1) offers a mechanism to do just that under the Options > Reading section of admin panel.

  1. Login to the Admin site
  2. Navigate to Write > Write Page.
  3. Create a page titled ‘Home’, and enter some text for the page content.
  4. Create another page titled’Blog’.
  5. Navigate to Options > Reading
  6. Under “Front Page Displays”, select the radio button labeled “a static page”
  7. Choose the page you’d like to display when users browse to your site from the “Front page” select box, namely the page titled ‘Home’ you created.
  8. Choose the page you’d like to display your blog posts from the “Posts page” select box, namely ‘Blog’.
  9. Click the ‘View site’ link in the Admin site header, and you’ll now see the text you entered as your ‘Home’ page content.

If the theme you’re using displays pages, you’ll see a link to your ‘Blog’ page, which will contain a listing of your blog posts. Now the front page of your site can display any custom content you want. Bos89.nl covers this process as well.
A potential downside of this is that the layout of your Home page and your Blog page will be exactly the same, since they both use the same page template in your theme. Perhaps you’re a more advanced user, and you’d prefer to have a three column layout on your Home page, and a one column layout for your Blog listing page. Page Templates are designed for just such a purpose. Page Templates are PHP files that are located in your theme directory that can be applied to any given Wordpress Page to determine how it will be displayed. For people comfortable editing HTML, here’s a method for creating a Home page with a distinct layout from your Blog page.

  1. Copy wp-content/themes/yourTheme/index.php to a file named blogTemplate.php
  2. Open blogTemplate.php in your text editor.
  3. At the top of the file, add the following code:
    <?php
    /*
    Template Name: Blog Posts
    */
    ?>
  4. Upload blogTemplate.php to wp-content/themes/yourTheme/ on your server, if you created it on your local machine.
  5. Login to your Wordpress Admin site, and create a page titled ‘Blog’.
  6. Expand the ‘Page Template’ option box on the right side of the page, and choose ‘Blog Posts’ from the select box.
  7. Save your page.

Now, when you view your Blog page in the front end, it will look exactly like the front page of your theme, listing all your blog posts. What does this mean? Now you can edit your theme’s index.php file to look however you want, and your site can maintain its blog functionality! You just need to ensure you have a link to your Blog and other pages accessible from the front page, which can be accomplished by using the wp_list_pages() template tag within your index.php code.

Some other resources along the same lines:

2 Comments     Jump to comment form | comments rss | trackback uri

1
Michael
September 5, 2007 / 10:19 pm

Thanks for the link. The flexibility of WordPress is really incredible. I like how you compare WordPress to commercial and open-source offerings out there as well. Although WordPress was developed with blogging in mind, it can be relatively easily adapted for other applications.

I don’t mean to put down WordPress, but Joomla is a very good open-source CMS offering as well, and is very well suited for larger and more featured sites.

2
gus
December 29, 2008 / 6:46 am

Great post!

Say what?

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>





About this entry

Categories