I’ve put together a REALLY basic ExpressionEngine mode for Panic’s new Coda. Consider it an alpha release. Right now it will just highlight EE tags and comments, along with HTML, CSS, JavaScript and PHP. There’s no autocompletion and no clips.
I’ve noticed that if your EE template doesn’t start with <html>, highlighting gets borked. A simple way to force it to highlight correctly is to start your template with an EE comment
{!-- EE Template --}
Anyway, I’m releasing it out in the wild to ask for help with it. Crack it open, check out the files and help me refine it.
Install it here: ~/Library/Application Support/Coda/Modes/
Then when you’re editing a template, change the syntax mode to ExpressionEngine in Coda. It should highlight all EE tags along with other common languages used in EE templates.
You will most likely need to reassign colors for the mode in your preferences.
So far it looks great. I haven’t had time to play a bunch with it, but did notice right off that the {embed=”“} tag is not colorized. Is this an oversight or am I doing something wrong?
I’ve updated the EE mode. Highlighting should be better now. It still colorizes embed as an attribute, but I think I like that. It makes embeds stick out a little. Let me know what you think.
Chris, great work. I’ve recently found myself using and liking Coda, and I think this will make it even more useful. Thanks for releasing this to the world!
I’ve updated the EE mode again. I started with a different base mode this time, just plain HTML instead of PHP-HTML. This reduced the size of the mode file from 62k down to 50k.
I’ve also got the embed tag colored correctly, along with other single-line EE tags like encode, switch, path, etc. Also, EE comments are now considered symbols, so you’ll find them in the symbols window.
I’ve still got some stuff I need to do with the highlighting:
* Color numbers in EE Tags, but ignore segment_X
* EE tags in string (e.g. <a href=”{path=“weblog/comment”}”>)
Right now, EE tags inside of attribute strings can really bork the highlighting. If a RegEx guru wants to crack open the mode file and look in SyntaxDefinition.xml, go right ahead. Any optimizing or fixes are welcome.
BBEdit sure is looking dated. Coda doesn’t seem much good to me other than a text editor, but it’s worth it for that alone and this bundle makes it complete. Thanks very much!
Keep in mind it’s not fully armed and operational yet, so it will mess up highlighting on some templates. I haven’t had time to get back to it this week, but maybe will this weekend.
Install it here: ~/Library/Application Support/Coda/Modes/
Then when you’re editing a template, change the syntax mode to ExpressionEngine in Coda. It should highlight all EE tags along with other common languages used in EE templates.
You will most likely need to reassign colors for the mode in your preferences.
Sorry for the dumb question when everyone else is using this fine, but I still can’t get this to work!
When I unzip your file, there’s a folder named Contents. Do I place this in the Modes directory, or do I place the file and folder that are inside this in the directory? Or do I just place the files/folders within the Resources folder in the Modes directory? To be honest, I’ve tried all three anyway, but still couldn’t get it to work!
Just to confirm, I start Coda up and open a file - I then go to Text > Syntax Mode, then should be able to choose an EE option? It just doesn’t appear for me. Do I have to activate it somehow?
Install it here: ~/Library/Application Support/Coda/Modes/
Then when you’re editing a template, change the syntax mode to ExpressionEngine in Coda. It should highlight all EE tags along with other common languages used in EE templates.
You will most likely need to reassign colors for the mode in your preferences.
Sorry for the dumb question when everyone else is using this fine, but I still can’t get this to work!
When I unzip your file, there’s a folder named Contents. Do I place this in the Modes directory, or do I place the file and folder that are inside this in the directory? Or do I just place the files/folders within the Resources folder in the Modes directory? To be honest, I’ve tried all three anyway, but still couldn’t get it to work!
Just to confirm, I start Coda up and open a file - I then go to Text > Syntax Mode, then should be able to choose an EE option? It just doesn’t appear for me. Do I have to activate it somehow?
Thanks,
Ste
SM9 when you unzip you should get a folder called ‘ExpressionEngine.mode’.
Easiest way in finder is to press shift + apple + G and copy and past ~/Library/Application Support/Coda/Modes/ into that and drag the ExpressionEngine.mode into the Modes folder.
Now when you open a template within coda you can click on the little settings/gear wheel at the bottom and go to ‘text encoding’ and then ‘expression engine’
As mentioned in the first post - you can put the tag {!—EE Template—} at the top of your templates if they aren’t getting parsed correctly.
Hope that helps!
And to Chris thanks so much for this plugin - I’m really enjoying the EE and CODA development workflow now.
Install it here: ~/Library/Application Support/Coda/Modes/
Then when you’re editing a template, change the syntax mode to ExpressionEngine in Coda. It should highlight all EE tags along with other common languages used in EE templates.
You will most likely need to reassign colors for the mode in your preferences.
Sorry for the dumb question when everyone else is using this fine, but I still can’t get this to work!
When I unzip your file, there’s a folder named Contents. Do I place this in the Modes directory, or do I place the file and folder that are inside this in the directory? Or do I just place the files/folders within the Resources folder in the Modes directory? To be honest, I’ve tried all three anyway, but still couldn’t get it to work!
Just to confirm, I start Coda up and open a file - I then go to Text > Syntax Mode, then should be able to choose an EE option? It just doesn’t appear for me. Do I have to activate it somehow?
Thanks,
Ste
SM9 when you unzip you should get a folder called ‘ExpressionEngine.mode’.
Easiest way in finder is to press shift + apple + G and copy and past ~/Library/Application Support/Coda/Modes/ into that and drag the ExpressionEngine.mode into the Modes folder.
Now when you open a template within coda you can click on the little settings/gear wheel at the bottom and go to ‘text encoding’ and then ‘expression engine’
As mentioned in the first post - you can put the tag {!—EE Template—} at the top of your templates if they aren’t getting parsed correctly.
Hope that helps!
And to Chris thanks so much for this plugin - I’m really enjoying the EE and CODA development workflow now.
Ahhhhhhh… I was looking past the containing folder and instead was getting fooled by the folder within that named ‘contents,’ as in, I thought that was the contents of the plugin…
Got it working fine now, thanks for the help with this!
I thought that might have been the case - glas to see you have it up and running.
Code and EE is quite a nice development setup I have found
I totally agree - it’s so nice not to have to use the plain text form box of EE itself and to instead, save the templates straight back to the server. So much more efficient!
On another note, for times when I’m not on machine with Coda or a similar editor, and absolutely must edit a template via the EE control panel, how do I make a ‘tab’ space? Pressing tab takes me out of the template window! I’m using a Mac. I find myself copying and pasting tabs when editing a stylesheet!
just wondering if there is a way to get the command + / shortcut to work with the expression engine bundle?
The shortcut is to comment selected code and I use it quite a bit when testing templates. For some reason when the mode is set to ExpressionEngine the shortcut doesn’t work.
I had a quick look through the bundle and compared it to the html bundle mode that ships with Coda but couldn’t see anything that might fix the problem for me.