Using WordPress as a CMS – Part 2

A principle of good software design is to balance the demand for new features with the necessity to maintain a high level of usability, and one sign of good software is that the interface remains uncluttered and intuitive as new functionality is added. For an example of how to do this the wrong way, look no further than Microsoft Word, which with each new release becomes more bloated and crammed with features that most people not only will never use but could never find out about even if they wanted to use them.

For examples of how to do this the right way, you could point to the web apps done by 37signals (e.g. Backpack), or to WordPress. Over the years, WordPress has continued to grow and to integrate new features, but has done a fairly good job of not allowing them to clutter core functionality. Following good usability principles like progressive disclosure means newbie users can jump right in and do what they want, while you don’t alienate advanced users by babying them with an impoverished interface.

A quick Google search for the terms “wordpress cms” reveals a plethora results, and the WordPress developers are aware that many people are using WordPress for much more than out of the box blogging. With that in mind, they continue to roll out functionality that makes it easier to use the platform as a content management system that can accomplish most of what you would want from your CMS.

Some of these features that you will find useful if not crucial to using WordPress as a CMS include:

  • the option to set a static or fixed homepage
    Prior to WordPress 2.1, you had to either hack around and create and upload a new homepage, or use a WordPress plugin to accomplish the same thing in a slightly more graceful way. Now, setting up a static homepage is as simple as going to the Settings > Reading panel and making the choice there. For more information, see Creating a Static Front Page
  • custom fields
    custom fields allow you to associate information with a post that goes beyond the parameters given to you by WordPress. Suppose, for instance, that you’re creating a WordPress site in which certain products for sale will be entered into the database as posts. Well, you’re going to want to store a bunch of particular information that will be associated with each product/post, including cost, availability, shipping, sizes, and so on.
    Using custom fields, you would type in a new key (say, “availability”) and then under the value, you would enter either “available” or “sold”. Then, when editing say, single.php (the wordpress template for single posts) you would access the data like so, from within the Loop:<?php echo get_post_meta($post->ID, 'availability', true); ?>If you wanted to make this data available outside of the Loop (e.g., in your sidebar), you would just type <?php global $availability; $availability = get_post_meta($post->ID, 'availability', true); ?>And then in sidebar.php, you would include <?php global $availability; echo $availability; ?>
  • page order
    Wordpress has only recently added the ability to define the order of your page manually, rather than using the options WordPress provides for wp_list_pages(), which are to sort by alphabetical order, or to sort by id. Though the functionality is new (and still a bit “janky” according to WordPress), it’s nice to know you won’t have to rely on third party plugins for such standard CMS features

In the next installment, I’ll discuss a couple more essential pieces for using WordPress as a CMS, including page templates, and also go further into third party plugins.

Using WordPress as a CMS – Part 1

For those searching for a free, feature-rich and easily-extensible Content Management System (CMS), WordPress is not to be overlooked. Not only is there a growing “literature” of blog posts and tutorials on how to use WordPress as a CMS, but the core developers seem to recognize WordPress’s suitability for this role and are continually providing further enhancements that make it easier to use WordPress in this way. And if there is some CMS-like functionality you need from WordPress but can’t get it with a plain ol’ vanilla install, there is a wealth of well-coded and reliable plugins among which you are likely to find a solution.

One powerful reason to make wordpress your CMS of choice is its ease of use. While Joomla!, Drupal and the like are all excellent CMSs, none of them prioritize simplicity to the same degree that WordPress does. This isn’t as much of a criticism as it sounds like–there is an inevitable trade-off between the available features and power of a piece of software and its out-of-the-box, so-easy-your-dog-could-do-it usability. WordPress is a platform for the unwashed blogging masses, while Joomla! and Drupal are fully-fledged CMSs that compare favourably with any enterprise-level solution you’d pay thousands of dollars for. Each understands its user-base and its niche and guides software development accordingly.

But in addition to being suitable for the masses, WordPress is a great choice if you’re doing a website for a client who either is a) not as comfortable with new technology; or b) has little time and is someone for whom the need to learn how to navigate a complicated CMS admin panel will be a significant barrier to actually using it. You can easily teach someone the WordPress “basics and then some” in an hour, which means satisfaction both for the client and for you (imagine all the support email questions you *won’t* be getting!).

That’s it for the first part of this mini-series. In the next post, I’ll dig in to some more technical issues and look at how recent advancements in the WordPress platform are increasingly making it a viable CMS solution.

Choosing a PHP web application framework

Having dabbled in ruby on rails but eventually given up for no better reason than that my web hosting provider (site5) is particularly difficult to get recent version of rails up and running (issues with rubygems and rails edge are attested in numerous places on the site5 forums), I set my sights on choosing a PHP web application framework. There are several reasons this makes better sense for me than rails:

  • Learning more about PHP will probably better aid me in my other work than learning more about ruby, as the three most common content management systems (Joomla!, drupal, and wordpress) are all PHP
  • support for PHP is much better on site5 than support for rails; support for PHP is in general much more common than support for rails
  • PHP-based web app frameworks don’t require anywhere near the memory footprint required by rails apps, which leads to…
  • … scaling issues? Actually, this isn’t really a concern. Most people have way bigger concerns than scaling like, say, getting their app to be popular enough that they have to worry about scaling. And while the spectre of Twitter and its many services outages that have been attributed to rails may be somewhat worrying, rails’ purported scaling difficulties are not foremost in my mind. There was a great comment on slashdot a while ago (wish I could find it…) that discussed how scaling problems can be greatly compounded by algorithm design and that, with well-designed algorithms most serious scaling issues can be nipped in the bud

So on to the PHP web app frameworks… What was I looking for in a framework? (for a comparison chart, see here)

  • lack of bloat
  • decent documentation
  • significant developer/support community
  • MVC architecture (does that go without saying?)
  • decent templating system
  • caching preferably
  • ability to extend easily with other classes
  • AJAX integration
  • PHP 5 would be nice

To make a long story short, after a fair bit of comparison and review, I narrowed it down to cakePHP and CodeIgniter. Though both seem very strong, in the end I decided to go with cakePHP based mostly on this write-up by Chris Snook a respectable web developer and fellow Canadian.

As Chris writes, cakePHP does indeed make querying dead simple. And their philosophy of “convention over configuration” means that though it may take a little bit of getting used to (and some occasional forgetting of whether to camelCase or separate_by_underscores) the amount of file editing for configuration purposes is greatly reduced.

So far I’ve been very happy with cakePHP and have been able to get some fairly complicated apps up and running in under a day (cakePHP offers powerful scaffolding similar to rails), though I do have to agree that the documentation could still use some more work, and I find myself often having to compose obfuscated Google search queries for things that aren’t easily findable in the manual or API docs.

Some quick tips for those getting the hang of cakePHP (version 1.2):

  • If you’re using UTF-8 collation in your database tables and web pages, you can make the necessary changes by adding the following line to your database.php configuration file:
    'encoding' => 'UTF-8'
  • don’t forget that just because you’re working with a copy of, say, a single record from your Posts model as $post in your views, you still need to reference fields like this:
  • want to get rid of those SQL debug messages at the bottom of all your pages, and you tried changing the layout but they won’t go away? Edit /config/core.php and change the ‘debug’ from 2 to 0. You can also alter the debug level by controller method — see this post from the cakePHP Google group.
  • a stupid mistake you may make too: if you’re trying to use php variable in a cakePHP findAll() function (e.g. $this->Post->findAll('blog_id = $id AND language = "fr"'));) and are finding it doesn’t work, it’s because for variables to be parsed by PHP, they have to be enclosed in double quotes; otherwise, the above code will find all Posts that have blog_id equal to $id not whatever $id evaluates as. This may throw you off as all the examples in the cakePHP documentation make use of single quotes and no variables. So, in the above example, you would need
    $this->Post->findAll("blog_id = $id AND language = 'fr'"));, a small but important difference

For some more tips on cakePHP, see here.

Facebook Camp

Having just returned from FacebookCampToronto4, I have to say that the more I learn about Facebook, the more concerned I become.

First it was the Youtube video about how Facebook owns everything you put on it, and is (somewhat loosely) connected to all sort of people/agencies involved in various intelligence gathering initiatives and operations.

That aside, what was somewhat disturbing during the event today was the way no one seemed to have any qualms about Facebook’s gleeful blurring of the “advertisement / editorial” distinction that is sacred to reputable journalism (not to claim that Facebook is engaged in journalism, per se, but the analogy holds).

Facebook proudly promotes as a “best practice” that people using their ad system link up their ads to users’ social actions, so that when I see a news feed item that, for instance, shows my buddy has gone to some event, the event organizers who may have posted an ad for that same event can have their advertising content automatically incorporated into the news feed item, piggybacking their paid advertising onto legitimate news about what my friends are up to.

The other thing that bugged me…

was how the redesigned facebook profile page (due to come out next week, and currently viewable at, though it’s pretty buggy) was being touted as a way to enable more/better “self-expression.”

I think we need to wonder about the degree to which trivial and largely superficial changes to our Facebook profile constitute an enhanced venue for self-expression. It’s a form of 21st century dandyism; I’m sorry, but if the way you express your “self” is by resizing certain boxes on your Facebook profile, your self is in dire straits.

The last thing that bugged me…

was the way we talk about addiction today, and how the goal of a Facebook developer (or of the creator of a new cookie, a new song, whatever) is to create something addictive. And, in the case of Facebook, not just addictive, but simple and pared down enough that it doesn’t actually involve any serious engagement. The goal of the creator is to create something that people will feel uncontrollably pulled to use, but only for short, intermittent periods of time with no purpose other than continued, addictive use. Consciously setting out to create things that are addictive is fairly ethically questionable.

I will take off my curmudgeon hat now.

The fundamental nature of intelligence

I came across an interesting request the other day from a DARPA consultant who was seeking input from the slashdot/computer geek community on projects that were pushing the boundaries of “neuromorphic computing” (better known as AI).

Among the goals of the project are:

measuring and understanding biological brains, creating AI systems, and investigating the fundamental nature of intelligence.

There’s something funny, something more than a little hubristic about the way this is put, as if it were just another US military project that was, oh-by-the-way, seeking to determine the fundamental nature of intelligence.

But beyond being a bit of a grandiose task, I think it’s framed the wrong way: intelligence is not something like elephants, electricity, or even quarks — it isn’t “out there, waiting to be described” in the same way that everyday physical objects are. Saying you’re setting out to understand “the fundamental nature of intelligence” is a bit like saying you want to determine once and for all the “fundamental nature of art”. Well, it turns out that your project is pretty much doomed to fail since how society defines, treats, and values intelligence (or art) is highly specific to cultural and temporal contexts.

Daniel Goleman‘s pioneering work on emotional intelligence, for example, is not so much an instance of “coming to a better grasp of the fundamental nature of intelligence” as it is a redefinition of intelligence, a re-valuation of certain traits that were previously less strongly associated with intelligence. It was a “persuasive redefinition”, to use a Quinean idiom, rather than a pure explication (if such a thing is indeed possible). But the word that comes so readily to mind when describing Goleman’s work (“pioneering”) reveals how deeply our tendency runs to view such work as grasping towards unexplored territory, shedding light into darkness; that is, revealing something “out there”, hitherto undiscovered.

But if there is no fundamental, universal nature of intelligence, then setting out to uncover the truth of intelligence is likely to just re-enforce and re-privilege certain notions of what intelligence is. I’m not saying that research into intelligence (even that conducted by comp-sci Ph.Ds with DARPA funding) will not be fruitful; nor am I even saying that it will be overly one-sided (there is fair bit of research going into making robots more emotional “intelligent”). All I mean to suggest is that those conducting such research be aware that they are entering a particularly value-laden field of research, one that deals with phenomena more socially constructed (using Ian Hacking‘s scale, from The Social Construction of What?) than in many of the other sciences.

Some thoughts on the coming of everybody

Clay Shirky discusses his new book, Here Comes Everybody, at the Harvard Law School’s Berkman Center for Internet and Society.

Very interesting guy. But I have to take issue with his main point, which seems to be that group action just got easier. Rather than overcoming the pitfalls of group complexity by introducing hierarchy, he contends, the internet makes the connections that comprise group complexity easier to produce–they are “more lightweight.” But if a connection is lightweight, how much of a connection is it really? Is it a connection when it can be broken with as little consideration as it takes to click a link?

This is part of the problem of with viewing human relationships in terms of networks and network theory. Before computer networks, we didn’t talk about “building connections” or “creating social networks”, as if making friends and community was a straightforward process that could be envisioned in advance and reproduced mechanistically. I don’t deny that this is frequently a useful way of talking and describing the world, but the metaphors drawn from the world of production and fabrication only go so far in the world of human relations and action.

    What is RSS?

    The fact that RSS has been around since 1999, yet we still feel the need (and with good reason) to put “what is RSS?” next to our RSS feed buttons (at least, on websites for less technologically-included audiences) suggests that something’s amiss.

    As Brian Clark at Copyblogger says, “the public at large either doesn’t care about RSS, or doesn’t know they’re using it”. Does this mean we should try harder to promote RSS, or rather that we should stop worrying about explaining it so much and trust that people who will benefit from it will, in general, begin to take advantage of it?

    I was at an online marketing for non-profits session the other day in which the presenter explained RSS as a technology that “emails news to your homepage.”

    At the time, I thought this was wildly inaccurate (which it is), but really, does it matter all that much? The outcome of that session will probably be that some people who are interested will go explore RSS more and maybe ask their tech people to look into it, and others to whom the idea didn’t appeal will let it slide for now.

    The fact that most explanations or RSS fall largely on deaf ears probably means we should stop trying to push RSS per se, and present it in ways that make it as easy to understand and as simple to use as possible — without feeling the need to nail down exactly what it is, how it’s different from/similar to Atom, or whether it means “RDF Site Summary” or “Really Simple Syndication”.