January 26, 2008 An Introduction to ExpressionEngine

ee-logo.jpgPeople may refer to ExpressionEngine as a blogging application, and it’s true that the design evolved from one; but it’s much more. Underneath the hood (get it?), EE has the power to drive even most large-scale websites. If you’re looking for a reason to invest some time and effort into learning and installing it, keep reading. This article is intended for those who might already have a website, but who want to upgrade to using a content management system, or for those who might be disillusioned by their current CMS.

Before continuing, you should know that I’m assuming: (1) that you know what a CMS is, (2) that you have a basic understanding of the technologies that power a CMS, and (3) that you have already explored, or at least browsed, the ExpressionEngine website and have a general idea of what it does. I don’t want you to get hung up on terminology or technical concepts and disregard ExpressionEngine as too complicated. One of the reasons for choosing EE over another content management system is because it’s easy to learn, deploy and use.

The weblog module

ExpressionEngine is modular, and is built for scaling. However, there is one primary module that could be considered the heart of the app: the “weblog” module. This module is where most content is stored and is extremely flexible. Case in point is the ability to change the name of the module itself — or, at least, the ability to put an alternate label on it. In fact, for the sake of clarity, and to underscore the dynamic range the module has, I’ll start referring to “weblogs” as “channels”.

Channels can be anything. They can be product catalogs, media archives, calendars, graphic libraries, et al. Think of a channel as a container of items, and the items as basically anything you want. ExpressionEngine allows for multiple (limitless, even) channels.

Perhaps the best way to illustrate this is by using The City Church website as an example. On our site we have multiple channels, all simultaneously available, and all accessed using the same (“weblog”) module. One obvious channel is our audio archive, where each message/sermon is an entry. Other channels contain our homepage content, small groups catalog, and online bookstore. Each channel is unique in both form and function, and, as I said, each is powered by the same module.

Field, category and status groups

If channels are the heart of EE, then groups are its arteries. Each channel has three group assignments as part of its setup: a custom field group, a category group, and a status group. These groups are separated from the channel so they may be actively accessible to other channels. This allows channels to share, say, the same categories, but still have different custom fields.

Custom field groups are comprised of … yep, custom fields. The default set of fields (Title, URL Title, Summary, and Body) are typical to a blog, but if your channel is meant to be something besides a blog, you can create new custom fields for it. For instance, for The City Church’s audio archive channel, I’ve created a custom fields that apply to a message and its audio file, such as “Speaker”, “Campus”, “Service Time”, “File ID” etc. (Read more on how the audio archive is powered.)

Category and status groups are basically the same. Statuses, though, play an important role as they have the ability to control an entry’s ranking or position.

More on groups can be found in the exhaustive ExpressionEngine documentation.

Templates

You can think of templates in ExpressionEngine just like web pages. In their simplest form, that’s all they are. Keeping the same analogous theme, templates could be considered the skin of an EE-powered website … beautiful, external, and flexible; yes, that works.

ExpressionEngine’s templates are what makes it so unique, but they’re also where most newcomers to EE get stuck. I think the flexibility they offer is, ironically, where the confusion comes in. Templates in EE lack the rigidity found in other CMSs. Instead of having a clear and obvious framework, EE’s templates allow you to think outside the box when architecting. The concepts are strange at first, however, the system is forgiving enough that when you finally get a handle on how it all works you’ll wonder how you ever did dynamic websites before.

The first thing to understand with EE templates is that they’re stored in the main, MySQL database, and are not actual files. (There is a caveat to this, though, because EE does let users save templates to the server as files.) Actually, when visitors browse an EE-powered website, they’re only ever accessing one file: index.php. That one file is able to reference the whole of the system, including templates, modules, and plugins.

Templates are grouped into “template groups”. Template groups are more than just organizational, and can be extremely versatile in function — more on that later. First, let’s look at the ExpressionEngine URL structure, and how template groups and templates come into play:

http://www.example.com/index.php/template_group/template

After the domain is the index.php file I mentioned. Again, that one file is the key to engaging the EE system. Once EE is invoked, it takes the URL request, and breaks it down; first looking for a template group, then an individual template. This URL structure is “human-friendly” (versus, say, www.domain.com/index.php?page=1&id=2), and also search engine optimized.

The tendency is to think of templates and template groups as files and directories — and that’s just what the EE documentation suggests — but that might lead to more frustration than anything else. I prefer to think of template groups as “topics” or “themes”, and templates as “functions”. I think of them this way because templates can be embedded into other templates, and template groups represent more than just groupings of templates.

When building a site in EE, you can use individual templates for each screen your visitors will see, or, if you’re clever, you could build one template — a Lord of the Rings type thing; one template to rule them all. How, you ask? Through the power of URL segments.

URL segments, global variables, and other such trickery

I mentioned that one of the primary reasons to choose ExpressionEngine is because it’s easy to learn, deploy and use; and that’s true. But the main reason I use it is because of its power and flexibility — most of which is found in features exclusive to EE.

The first such feature is URL segments. As I’ve illustrated previously on my blog, URL segments can be extremely useful when coupled with templates. Since ExpressionEngine is essentially taking over the job of serving a website (from the server itself), it also actively processes URL requests, no matter how long, and breaks them down into what are called segments. So in our example above, EE would see the URL and assign {segment_1} as “template_group” and {segment_2} as “template”. It’s not hard to imagine how beneficial having that kind of association can be. I’ll give you an example.

Let’s say you’ve been asked to make some changes to the “About Us” section of a website. No, problem, right? Just pull up the “about” template, make the changes, and hit “Finished”. But what if, before the changes are published, you have to get them approved? You could create a new template, call it “about-preview”, and copy/paste the “about” template in, make the changes, and send the new URL to your client for approval. Or, by using URL segments, you can make it much easier and transparent. You’d just open the “about” template, wrap the changes in a conditional statement — {if segment_3 == "preview"} — and tell your client to add “/preview” to the end of the URL.

We can even take this example further, and apply some other cool ExpressionEngine features like global variables, member groups, and plugins.

To protect the changes from prying eyes, you could also require your client be logged in before viewing the changes. You’d do this by changing the conditional statement to {if logged_in AND segment_3 == "preview"}. Or you might want to make sure only they can see it, not another logged in member: {if username == "client_name" AND segment_3 == "preview"}. Even better, let’s make an idiot-proof link they can click to see the changes:

{if username == "client_name" AND segment_3 == ""}<a href="{path=template_group/about/preview}">Click here to see changes</a>{/if}

To show your client that they are, in fact, viewing the latest revision of changes, you could include a time-stamp, showing the time the “about” template was last edited: (Edited: {template_edit_date format="%%F %d, %Y at %h:%i %A"}), which would render as “(Edited: January 26, 2008 at 4:53 PM)”. You could even include the time since they last visited by employing a third-party plugin called “Since Last Visit”.

Can you see how powerful (and even fun) ExpressionEngine can be?

Flexibility at a premium

What makes ExpressionEngine so flexible could also be considered its greatest weakness. That you have to edit and save templates inside a web browser makes for a terrible development workflow. Who wants to write code in a text area field? Yes, there’s a way around it, but even that method comes with its fair-share of issues. It’s peculiar, but I believe the template model itself, though versatile and dynamic, is the Achilles heel of ExpressionEngine.

Start your Engines

Despite some small flaws, ExpressionEngine remains a highly capable, extremely flexible website CMS solution. Even the free, Core version packs enough punch to handle a typical blog or small site. I’ve been using it since version 1.0 (actually, since pMachine Pro), and I continue to be amazed and inspired by each new release.

If you’re considering making the switch, I hope you found this quick introduction motivating enough to get started. I suggest you take the next step and download the Core version. You should also browse the documentation and Knowledge Base, both of which are well-maintained and written.

In addition, the EE Forums remain the best resource for learning ExpressionEngine, hands down. The support community on the forums is responsive, helpful and passionate.

You might also be interested to know that some highly respected designers and studios already use ExpressionEngine; Happy Cog, for example. Others include:

So, to answer the most-oft question I receive via email: yes, I highly recommend ExpressionEngine [affiliate link].

66 Comments


January 23, 2008 More “Hey Apple, Don’t Make Me Think”

Derek Powazek is pointing out an oddity found when comparing the interface of Safari on a desktop to the one found on the iPhone. Basically the order of elements in the toolbar at the top of the window is completely opposite — which forces users to take an extra few milliseconds to process.

Apple has to change this on the iPhone, and soon, in order to unify the two interfaces; but my guess is that they won’t because the context of the two interfaces differs so much (e.g. desktop versus handheld), and because 4-million-plus iPhones are already floating around. I also wonder how close the benefit-to-detriment ratio is. Have users already gotten used to the refresh button being located to the right of the location bar?

No, seriously. Stop making me think!

Stranger — and of higher priority to me — is the conflicting behavior of the multi-touch trackpad on the MacBook Air and the multi-touch display on the iPhone. On the iPhone, for example, to advance, you swipe from right to left. It appears, though, it’s the opposite on the MacBook Air! Oh, boy.

I already have a hard enough time switching between the iPhone and my PowerBook equipped with a two-finger sensitive trackpad. In MobileSafari, I swipe from bottom to top to scroll down. On the PowerBook, I do the exact opposite. The first time I accidentally used the iPhone method on my PowerBook, I actually got my hopes up, thinking my trackpad had died — after all, if that were the case, I’d be forced to upgrade to a MacBook Pro, right?

And I know I’m not the only one to deal with this. [Reference link forthcoming.]

I understand this whole multi-touch thing is a new world for Apple, and I’m willing “sacrifice” myself and my time (the seconds-worth it requires) while they work these things out. However, I do hope they understand they’re training the world to a new interface right now. I wonder, if they’d been this all-over-the-map with the iPod scroll-wheel, would it be the success it is today?

1 Comment




January 16, 2008 My Thoughts and Reactions to the Macworld 2008 Keynote

The biggest surprise from this year’s Macworld Keynote was that there were no surprises. It’s actually quite a conundrum we have here. On the one hand, we all love to hear rumors, predictions and so-called leaked information from Cupertino; but on the other, we love being surprised by announcements we didn’t see coming. I wonder, sometimes, if part of the latter love stems from a passive, sinister desire to see people proven wrong. Nevertheless, the lid on Apple HQ has been compromised as of late.

That said, I’m still impressed with how well Steve Jobs presents — even when we know what’s coming. If the company is to out-live the man, they must find someone to replace the man, not the position.

But this article is about the products, not Steve.

Time Capsule

Time Capsule looks to be the best product no one will buy. The idea is right, I just think it lacks the simplistic appeal that it needs. The concept behind Time Machine is making the inherently inconvenient and difficult seem easy (and even fun). Look no further than Time Machine’s quirky interface to see how Apple is trying to appeal to the average consumer.

But Time Capsule doesn’t appeal to the average consumer. The people who spend $300 to $500 on a backup solution are already passed “easy”. They’re the guys who’ve setup scheduled backups and drive redundancy.

I’m sure they’ll sell plenty of units. I just don’t think they’re sell them to Average Joe; at least not at $300 each.

I hope I’m wrong, though. I can’t stress enough how important backing up is. If Apple gets my mom to backup, praise the Lord!

iPhone and iPod Touch software updates

The iPhone software update had a bunch of new mini-features that probably all deserve some sort of attention and review, but the one that I was most excited about was multiple-recipient SMS.

Isn’t that sad?

It took 5 months for Apple to finally address this. I literally had a “what am I thinking?” moment yesterday as I realized every other mobile phone on the market, from freebies to smartphones, could do what I was so excited I could finally do. Now if we could just get MMS on the thing …

As for the iPod Touch update, my father in-law had the best response: “I can’t believe I have to pay for software updates for my iPod Touch! Where do I swipe?” Agreed.

It’s $20. It’s worth it. Get over it.

iTunes Movie Rentals and the Apple TV

I have little to say about the iTunes Movie Rentals and Apple TV announcements; though they’re arguably the highlight of this year’s keynote. When Apple first introduced TV shows, I knew it was too early. When movies came out, it still felt early. Now? Well, I think we might be getting there.

My wife and I haven’t rented a movie in months, but we will now. And I’ve wanted to want an Apple TV since it was introduced last year, but just couldn’t. Now, though … ? Maybe so.

Both items are awesome. I anticipate both succeeding.

MacBook Air

Two years ago when I said Apple had missed a niche market by introducing the MacBook, I had in mind a sub-notebook for the professional, mobile user — someone like me, who prefers to work outside the office. On the surface the MacBook Air looks like it fits that niche.

The product tagline is “Thinnovation”, and how fitting it is. Still, with no intention of demeaning the genius engineers who worked on it, I will say this: It appears more innovation was put into making the MacBook Air thin than anything else. In fact, except for the thinness, the dimensions of the MacBook Air hardly reflect “sub-notebook” standards. (The thick bezel around the 13.3-inch display doesn’t help the illusion, either.)

But then again, maybe the MacBook Air isn’t meant to be a sub-notebook. Actually, I didn’t hear or see one reference of “sub-notebook” during the keynote — everything was “thin notebook”.

So did Apple miss the niche again? Maybe.

When Steve Jobs introduced the MacBook Air, he heralded Apple’s refusal to compromise in several areas: thinness, display size, keyboard size, and processor speed. While they succeeded in delivering on all of those areas, the processor speed is most certainly a compromise. The MacBook Air peaks at a 1.8GHz Core 2 Duo, nearly half a configurable MacBook Pro. Think about that. Half the speed.

Another head-tilting decision Apple made with the MacBook Air is the hard drive capacity. Why not offer a 160GB model? After all, what is a MacBook Air owner to do with all the TV shows they download from the iTunes Store after they view them? They can’t burn them to a CD or DVD! I, for example, can’t even fit my iPhoto library on my 80GB internal PowerBook hard drive. I keep it on an external firewire drive. How would I manage a library this size on a MacBook Air?

More criticism for the MacBook Air abounds; most of which is just typical industry feedback and nearsightedness. Some, though, has validity: the MacBook Air’s memory capacity, lack of swappable battery, lack of ethernet port, and lack of FireWire ports. What was that you were saying about not compromising, Steve?

The fact is, Apple did compromise on the MacBook Air. It would be impossible not to. Laptops and consumer electronics are all about compromise. The trick is finding the right tension in the manufacturing side versus the consumer side of compromise. Remember, consumers have to make compromises, too.

The 12-inch PowerBook G4 seemed to break the rules, though. It shared all the major features of its big brothers, the 15- and 17-inch models; but it still had smaller dimensions. The compromises were minimal: no back-lit keyboard, less USB ports, no native DVI port. I guess I sort of expected a resurrected 12-inch PowerBook G4. Instead, the MacBook Air feels like a dumbed- albeit slimmed-down version of the MacBook … last year’s MacBook.

So I’m torn when it comes to the MacBook Air. It’s like buying shoes that will be too tight: if you can pull it off, not harm yourself while wearing them, and still get your job done, then do it. Just be sure you bring along a shoe-horn (aka USB hub).

13 Comments