Before we actually build anything, we first need to consider how ExpressionEngine thinks about content. Most of this section was originally written by Mike Boyink in tutorials that were available for ExpressionEngine 2 and is reused here verbatim and with permission - these fundamental concepts are absolutely still applicable. Thanks Mike for all your work laying the foundation and allowing us to reuse it! I have however, made some updates and additions to make sure it's all still pertinent to ExpressionEngine 6.
In This Article
- Page Management vs Structured-Content
- What’s the advantage of Structured Content?
- How does ExpressionEngine Store Content?
Page Management vs Structured-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 ExpressionEngine, you build a site from the bottom up, first defining what type of content the site has and building structures to store it. In other words, websites have different types of content in them, and it’s not always just a “page.” Some examples include:
- 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 with names, numbers, colors, weight, descriptions, photos, and possibly more.
- Portfolio of work, which we'll flesh out in this tutorial, that includes the client/project name, link, description, and images which are organized by category.
As it turns out, what we’re doing here has a nifty buzzword in the web industry: Content Modeling. A List Apart 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, 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.
So 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 in other places on 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.
How does ExpressionEngine store content?
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 the content-modeling tools available in ExpressionEngine:
- Channels & Entries (docs link) are the basic storage container of content in ExpressionEngine where Channels represent real-world collections of items and "Entries" are the individual items inside them. 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. -Fields (docs link) are the smallest unit of content storage in ExpressionEngine. There are different types of fields; text box, text area, checkbox, radio buttons, dropdown, file (i.e., image or document), rich text, grids, etc. EE’s Fieldtypes are extensible, which has allowed an aftermarket of additional types of fields to flourish. Fields can be applied to Channels individually or in groups and shared by multiple Channels (or groups).
- Field Groups (docs link) allow you to group a selection of Fields and apply the whole group to a Channel at once, thereby applying all Fields inside of it to the Channel. This is a handy way to keep things organized, particularly where certain sets of fields are reused in multiple Channels. Individual Fields can be assigned to multiple Field Groups too.
- Category Groups (docs link) contain individual Categories, and the whole Group is assigned to a Channel so that Entries inside that channel can be categorized. A single Category Group can be assigned to multiple Channels, and each Channel can have multiple Category Groups assigned to it.
- Categories (docs link) are simple filtering mechanisms, a way to knock a big list down to a smaller list. An Entry in an ExpressionEngine Channel can be assigned to multiple Categories, and Categories can be nested to offer multiple levels.
- Statuses (docs link) are ExpressionEngine’s way of letting you have Entries that are "Open" (live on the site) or “Closed” (saved into EE’s database but not live on the site). You can also add more Statuses if you need a “Pending,” “Featured,” or other statuses, and limit each Channel to only be able to use certain Statuses.
- File Upload Directories (docs link) hold any uploaded files like images and documents. Think of these as folders on your computer - you can create as many as you'd like to help keep documents organized. When setting up File or File Grid Fields, you can either allow the content editor to choose what directory they upload to or force a specific upload directory specific to that Field.
With the foundational understanding from this article, we’ll move to Part 3 and look more specifically at the content we want for this project 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.