02 - How ExpressionEngine Thinks About Content
So we’ve chosen a sample site to build, have downloaded the front-end code for it, and also have a fresh ExpressionEngine install to power the back-end of the site.
Now what? Where to begin?
Let’s start by getting a high-level view of how EE thinks about content.
If you’ve worked with a CMS of any sort in the past you might be perusing the ExpressionEngine Control Panel for a place to begin by building a sitemap or establishing navigation. Many CMS work this way - you essentially build a site from the top down by first creating hierarchy/navigation using some sort of tree-view widget, then you choose a page on the hierarchy, click a little icon and enter content for that page. I would actually call a system like this more of a “Page Management System” - since it only thinks about and manages web content in units of Pages.
ExpressionEngine, however, is not a “page-based” CMS but rather a “Structured-Content Management System”. With EE you build a site from the bottom up, first defining what type of content the site has and building structures to store it.
I’ll pause a moment while you take that in.
Yes, websites have different types of content in them and it’s not always just a “page”. Some examples:
- FAQs which are made up of question and answer pairings.
- Timelines which are collections of date and event pairings.
- Bios which are often made up of a person’s name, title, photo, and a details field where their basic career path and accomplishments are listed.
- Products that have names, numbers, colors, weight, descriptions, photos and possibly more.
As it turns out, what we’re doing here has a nifty buzzword in the web industry: Content Modeling. A List Apart recently published an article on Content Modelling, describing a Content Model as documenting:
...all the different types of content you will have for a given project. It contains detailed definitions of each content type’s elements and their relationships to each other.
If you come from a database background (as I do) you will recognize this process as Database Normalization which Wikipedia defines as:
...the process of organizing the fields and tables of a relational database to minimize redundancy and dependency.
What’s the advantage of Structured Content?
- Content is more reusable. Because you store it and manage it in small chunks, you can use it in small chunks. Pulling a random FAQ or Featured Bio other places in the site is easy.
- Content is easier to manage. By breaking content down into a collection of small bits, content editors can focus on just the small bits. Entering new content becomes as easy as filling in a few fields and clicking a button.
- Content and Presentation are separated. Granular content means more presentation code can be moved into the templates responsible for it. Changing presentation becomes easier with centralized markup.
ExpressionEngine Content Modelling Tools
Assuming you are now “seeing past the page” when it comes to the content on your project site, the next logical question would be: “How does ExpressionEngine store content?” Let’s run through them:
Channels are the basic storage container of content in EE. Conceptually channels are made up of rows and columns - much like a spreadsheet or database table. The columns are called “Fields” and the rows are called “Entries”. Channels can be simple with two fields or complex with 200 fields - it all depends on how complex the content is you are storing. The rule of thumb is to keep one channel about one type of content - don’t store both customer and project information in one channel but rather in two.
- Field Groups
In ExpressionEngine fields are collected into a Field Group before being applied to a Channel. Field Groups can be assigned to multiple Channels, but a Channel can only have one Field Group assigned to it.
- Channel Fields
Channel fields are the smallest unit of content storage in ExpressionEngine. There are different types of fields; checkbox, radio button, text box, text area, rich text, etc. EE’s Fieldtypes are extensible, which has allowed an aftermarket of additional types of fields to flourish.
- Category Groups
Much like Field Groups hold multiple fields, Category Groups contain individual Categories. Where Categories differ is that a single Category Group can be assigned to multiple Channels, and each Channel can have multiple Category Groups assigned to it.
Think of a Category as a simple filtering mechanism, a way to knock a big list down to a smaller list. An Entry in a ExpressionEngine Channel can be assigned to multiple Categories.
- Status Groups
You’re probably seeing a trend by now - EE groups individual status settings into a Status Group. A single Status Group can be applied to multiple Channels, but each Channel can only have one Status Group assigned to it.
A Status is EE’s way of letting you have Entries that are Published (live on the site) or “Closed” (saved into EE’s database but not live on the site). You can also add more Statuses to a Status Group if you need a “Pending” or “Featured” etc.
With the overview out of the way in the next installment of this series we’ll look more specifically at the design template we’ve chosen, and put together a Content Model for it. The Content Model will lay out the specific mix of Channels, Fields, Categories and Statuses this website will need.
Here are some other articles that cover how EE works - I’d recommend giving each of them a read-through for a slightly different perspective on how to explain it.