Articles
Displaying category "ExpressionEngine"
Tidy URLs in ExpressionEngine
ExpressionEngine’s strict template_group/template URL structure allows for some wonderfully tidy content organization. However, an annoying downside to this structure is that EE’s URLs tend to be a bit overgrown. For example, say I have a “blog” template group, and I have a “single.php” template within it that I use to display single posts. The URL would look like this:
http://www.mysite.com/index.php/blog/single/the_title_of_the_post
I don’t know about you, but that index.php in the middle there just hurts my brain. There are a number of techniques to get rid of it involving some .htaccess trickery, but I couldn’t find one that worked properly on my hosting setup. But hey, what about just renaming it? EE has a nice little writeup explaining how to do so. I just renamed my index.php to “v1” (with no extension) and now it looks like a nice directory in the URL. Niggling problem solved.
http://www.mysite.com/v1/blog/single/the_title_of_the_post
See, better already! But wait - there’s plenty more you can do here.
Basic ExpressionEngine Layout Tips
I’m already very impressed with ExpressionEngine’s versatility. It’s caused me to reconsider a few things about how content management systems can work.
I used to use WordPress and force it to be a content management system. For a while there, I played around with Chyrp, because it was so lightweight that I could go in and mangle it into whatever I wanted to be. Basically, I preferred systems that allowed me to dig right into their code and adjust things at my leisure.
I thought ill of systems that had their own templating language, but EE’s templating system is so well-done and comprehensive that I haven’t had to write one line in PHP yet. This kind of functionality — not to mention the brilliantly comprehensive documentation — is miles away from the days when I was cross-referencing WordPress functions to try to deduce what kind of data a particular object contained.
EE is great. But, for some reason, the built-in template is quite wasteful. There are too many files, code is repeated everywhere … it’s a bad initial example for anyone looking at EE for the first time. So, for your benefit (hopefully), here are some templating tricks I’ve learned from my first big dive into ExpressionEngine.
Information
Cameron Daigle is a designer who scribbles information in notebooks, in his head, or (ever so occasionally) on this website.