Working smarter with Expression Engine

25th October 2006

Following on from my Expression Engine Top Ten Tips Part One and Part Two, here’s a quick run down of nitty-gritty ways I like to work smarter and smoother with Expression Engine. Your mileage may vary, but they do it for me. And it’d be great for you to share your neato tips too.

1. Comment your template code

It’s a little-know feature of Expression Engine that I’ve only just started using, but it’s super-useful. Any template code wrapped in {!-- and --} will not be rendered, making the comments available to you when editing, but not visible on the resulting page. And because any Expression Engine code or PHP isn’t rendered either, it’s handy for dropping snippets in and out during testing. Slighly more information available in the docs.

2. Use Template Notes

In a similar way, the Template Notes feature is a great place to paste chunks of code you need to quickly refer to. You’re using template revisions, right? So use Template Notes to store the revisions you want to keep.

3. Keep everything at your finger tips with tabbed browsing

If you’re using a browser that supports tabs, it makes sense to have different sections of the Expression Engine control panel open at the same time. From left to right, I tend to have my main CSS template, then a tab for general templates, then a tab I use for Publish and Admin and finally my site. It’s simple and obvious, but it saves miles of mouse travel and clicks.

4. Hook up to an external editor

Colly got me into the idea of using an external editor to work on my EE templates. This combination of Saft and TextMate works like a dream so far. I certainly don’t use half the features I could, and I’ve only toyed with the idea of using code bundles, but it’s certainly helpful - and you can easily keep your code more cleanly structured and formatted.

5. Establish naming conventions that work for you

Everyone has a different way of working, so I’m not going to tell you what to name your templates, weblogs and variables. But it’s definitely helpful if you setup some conventions that work for you, and stick to them across projects. Extend this to your CSS and you’ll soon be gliding around your code with extra finesse. It becomes even more useful when you’re working with other people, and all singing from the same song sheet.

EE Comments - this is very interesting! I’ve been using Textmate for most of this year. It’s great, but I use it in tandem with Transmit and the Docksend feature. But there is a lot of dragging. BBEdit has a ‘Save to FTP Server’ option which I’m sure must be possible in Textmate somehow - I have’nt looked into it enough. The Textmate EE Bundle is a fine addition.

I have been enjoying your posts on EE. Many of things you mention I have already been doing, but it’s nice to know that the way we do things with EE is also in use by you guys as well.

Comment your template code: I have just begun to really put this to work. I always hated sharing my notes to myself with the world at will. Now I am more prone to leave detailed comments when needed.

Use Template Notes: I haven’t had to use this too much, but it’s always nice to be reminded that you can tuck whatever you want away in a note. However, I don’t make use of the revisions option. Maybe I should.

Tabbed browsing: Couldn’t aggree more! Yes, a must have for a hard working efficient EE developer.

Hook up to an external editor: The EE world changed for me once I was able to use Textmate with ExpressionEngine! Thanks for the tip way back when Colly! :)

Establish naming conventions that work for you: This is a must! Once you’ve embraced a personal standard in naming conventions mixed with the names for weblogs, markup ID & Class identifiers, template names you’ll be on fire. I just wish that the categories could be referenced by field name vs an ID.

The one thing that has really helped us when building out an EE site is to apply the Rails naming convention for partials to EE. I add a prefix underscore to partial templates that get embeded. Doing this allows the true templates in a template group to surface to the top of the sort and partials now become easily identifiable.

This is great stuff.. as it appears this is being read by seasoned EE developers.. does anyone know if it’s possible to upload multiple images to an EE gallery in zip format and have it extract the zip on the server?

The EE batch entrie is good, but not ideal for end-users as they have to learn FTP.

Excellent tips. I couldn’t agree more on the last one, standardizing naming conventions (and techniques/widgets too) from project to project has been my key to getting more done. There’s always a temptation to be unique with every new client and every new site.

I’ve gotten myself in trouble with the tabbed browsing, accidentally having multiple versions of my CSS file open in different tabs or windows and then alternately updating them and wondering why my changes were disappearing.

Responses are now disabled Your ability to respond is disabled automatically some 30 days after articles are published, or manually much sooner if spamming guttersnipes target a particular article.