After being hacked last week, I set out with the ambitious aim to learn ExpressionEngine and move my site across over the course of a weekend. I’m proud to say for the most part, I got there (although really I ended up needing most of Monday and Tuesday as well to smooth out the kinks).

After going through the whole business, I’d like to share a few concepts and resources that may save you some time and give you a bit of a general primer in “EE. EllisLab do a great job with their user guide and forum, but at the time I remember being frustrated by how many different sources I had to use to get all the info I needed. I went in pretty much clueless about what I was doing, but having a site already built in WordPress definitely made things quicker.

Introduction

Is “EE for me?

Before we get started, I thought this was worth mentioning: just because it’s the right solution of one person / website, really doesn’t mean it’s the right fit for another. If I were setting up a basic blog which would just contain entries and a sidebar, WordPress or some such would probably be my weapon of choice.

Makin’ screwdrivers

“It’s a screwdriver factory, and you’re in control.”
Brad Dillon
Developer and recent fellow-convert

ExpressionEngine’s flexibility makes it great when you’ve got specific needs that go beyond a basic blog, but if you don’t, keep in mind it may end up being more work for less actual gain. All I’m saying is download the core and check it out for yourself before you fork out the money for it.

For me, I just needed little more flexiblity. I think Brad Dillon explained the difference between EE and something like WordPress best:

“WP is like a philips-head screwdriver. A beautiful, incredibly well-constructed screwdriver, made of solid gold, and encrusted with diamonds. It has a nice rubber grip that never slips and allows you to maneuver easily. EE, on the other hand, being that it has one foot in the CMS realm, is a much more modest, yet more powerful tool, which can be used to make screwdrivers. Screwdrivers of any kind or fashion. Flat-head, philips-head, torx, even hex-socket screwdrivers. It’s a screwdriver factory, and you’re in control.”

Step 1

Planning

Thinking in chunks

The first key concept I had to fathom was simply thinking about my website in terms of its groups of repeating information rather than its pages. So for me, instead of thinking in terms of Work, Journal, Bio, etc I broke up the site in terms of its chunks of information. Here’s what I ended up with:

Pretty basic huh? Well that’s because my site isn’t all that complex. Which makes it great as an example. These are the groups of information in my site that can be broken down into individual repeating items (by repeating I mean they have multiple items that follow the same format). It’s really a good idea to use weblogs as much as you can. The more you do, the more you’ll be getting your money’s worth from “EE and the more dynamic and flexible your site will become.

Web…log?

In ExpressionEngine (pre 2.0) these groupings of information are called ‘weblogs’. Now this is a major source of confusion starting out, so if it helps you, think of them as ‘sections’ or ‘channels’. A weblog isn’t the whole blog in EE, it’s just a grouping of information. Of course, there are other things on my site that don’t fit into these 4 ‘weblogs’, but they’re ‘one off’ items like a contact form, for example, so we’ll leave them out for the moment.

Break it down

So the next step is breaking it down a little further. Each ‘weblog’ (group of information) can be broken down again into individual parts. For example if we look at the journal articles on the right, you can see the parts that make up each of my journal articles. Of course, mine’s a little convoluted given my layout, but hopefully you can get an idea of how modular you’re making the data.

If you’re familiar with blogging systems like WordPress, you’ll be thinking in terms of Title, Body and Excerpt. But if we’ve got another group of information that doesn’t just follow this standard style format (for example a group of testimonials), we would normally run into trouble. This is where ExpressionEngine starts to earn its keep as we’re free to make up the format ourselves.

Custom fields

Each individual input within our weblog is a ‘custom field’. In EE, as you can see on the right, we can name these fields, choose whether they’ll be made up of a little text (like a name) or a lot (like a blog entry) or even if they’ll be a file or select list. These fields you’ve created will come together to make a form by which you can input your data in an organised way.

If you’re still with us at this stage, you’ve really done more than you think. Now to really cement these concepts, check out ExpressionEngine’s video tutorial on weblogs and custom weblog fields (ExpressionEngine)”:.

All the custom fields for the journal articles weblog.

Step 2

Inputting & migrating data

If you’ve planned things well, this stage should be pretty easy. Really, you just have to manually fill out the forms you’ve custom made for each entry within each weblog.

Movin’ it over

However, in my case, I already had a bunch of journal articles I’d published in WordPress, so I had to migrate this data across to keep all the associated comments and details of each entry. For this I used the WordPress to Moveable Type exporter plugin. This plugin (more accurately a theme) outputs your blog in a flat text format which you can use to import directly into ExpressionEngine.

What’s really cool here is if you’ve already planned out how the information is going to be broken up, you can edit the outputted HTML file to fit this format. Remember that while you’ve got all your old WordPress blog data in one HTML file, you can Find & Replace all the information that needs changing before you import it into ExpressionEngine (like convert links and paths for example). I got rid of a lot of WP-related css styles, all the image caption DIVs as well as sorted out the body text into left and right columns.

When it came time to import the data, I was able to simply match up the custom fields with the label on each entry and presto! we’re migrated. Another thing to remember – when labeling your HTML file data, use up the provided fields (Body, Extended Body, Excerpt etc) before+ using the EXTRA FIELD-1 etc. “EE will love you for it. You can find all the info you need on using the migration tool here.

If you’re moving from somewhere other than WordPress or Moveable Type, ExpressionEngine has directions on that too.

Step 3

Templates

So for a quick-and-dirty on how templates fit into all this, I’d recommend heading back to the ExpressionEngine video tutorials for an explanation.

At their simplest, templates are just the pages which make up your site. As their name suggests, they don’t have to be just single pages, as they have the ability be ‘reused’ depending on what is happening in the “URL.

Embed and embed some more

A template also can also be embedded in other templates (much like PHP includes), which allows you to break up your pages into sections. For my site, I created a template group called ‘includes’ which were all the things that repeated in each page (header, footer, navigation and google analytics code). I then created another template group called ‘modules’ (which is a bit of a confusing name) for things like my testimonials panel, linklists panel, case studies panel etc).

These smaller templates can be uses many times throughout the site in other various templates. What’s cool is if I want to change the site description in my header, for example, I only have to alter the single ‘includes/header’ file and that change will be reflected throughout the site.

Another really handy thing to know about is the ability to pass variables on to the embed. This adds yet another level of flexibility.

Using templates to grab certain pieces of information from your weblogs is where the magic of “EE happens. I’d reallly recommend following EE’s video tutorial on combining weblogs with templates (hopefully the penny will drop here).

I found it also really useful to save my templates as flat files so that I could edit them directly in Coda (my editor of choice). Incidentally, if you use Coda or another “IDE, there’s also a cool little .htaccess trick to allow live previewing of templates from inside the app.

Note the ‘save template as file’ at the bottom.

Step 4

Putting it all together

Training wheels come off

I’ve been moving pretty slowly up until now, but at this point, you really just need to dive in and go for it. The next thing to do is get properly acquainted with ExpressionEngine’s modules and tags. To start off, you probably only need to worry about the weblog, and maybe comment modules.

You should have your weblogs stocked with data and now it’s just a case of learning how to output this data amongst your HTML via your templates. When you start out working with ExpressionEngine code, some of the examples you’ll find may look intimidating at first. You’ll be surprised at how simple the whole thing is, especially if you’ve had any prior experience with using conditional statements, or variables (which you’ll probably be using quite a bit here).

Handy extensions

So there are quite a few extensions out there. Some are free and some are quite pricey. Here are a few that I’ve found to be pretty handy:

On this site, I’m also using Askimet Check and Linklist Module. This is a lovely change from the 14 odd plugins I was running with WordPress.

Getting date formating right

However you like to format your dates, you probably want to check out
the EE date formats

Cleaning up the URL
The header & footer
Navigation
Categories
Lastly

Final tips

Some extensions don’t play nicely together

Just something to be aware of. If you notice you’re suddenly getting a blank screen or an error after enabling a plugin, it may be the extension’s fault, or perhaps a clash with another extension. The old disable-one-at-a-time method is probably the best way of finding the culprit.

Use more than 8MB memory in PHP

This isn’t essential, but if you’re getting a blank screen occasionally, this could be the cause (as it was for me). If this is a problem, you need to change to “memory_limit = 32M” in your php.ini, or add ‘php_value memory_limit 32M’ to your .htaccess file.

Use the Admin search function

You’ll find yourself using the ‘back’ button a lot and getting lost in the many, similarly named admin option areas. The fact they offer a search field in the first place is a bit of a worry, but seeing it’s there, save yourself some time and use it.

Add new tabs

If you find yourself going to the same pages within you “EE admin, click the ‘add tab’ link to add that page as a top level tab so you can get to it directly.

Misc handy resources

—Published 16 March, 2009

Next