I must be missing something. Creating custom templates for MT is SO slow. I welcome suggestions on how to be faster. Here’s my typical process:
I begin by creating some XHTML and CSS for a custom design. Then, I copy and paste the template files I need from the MT admin into a local code editor where I save those as local HTML files (e.g. /Templates/Entry.html). That way I have a local copy of my templates, and I can customize them in my code editor of choice.
After I tweak things, I copy and paste the code into the MT admin, publish the templates, wait, then refresh the site.
Oh shoot, that doesn’t look right.
Tweak. Copy. Paste. Publish. Refresh.
Over and over and over again until the site is ready.
Is there a faster way to get my local changes up on the server? Direct FTP of MT templates would be nice. Automatic republishing would be nice.
Thoughts?
Reported on Movable Type 4.2
Hi Clifton,
I designed a template set for MT and did it the same "slow" way: Tweak. Copy. Paste. Publish. Refresh.
If there's an easier way, I'd love to know. I haven't used the Design Assistant, perhaps that is an option?
You can link all your templates to a static file on the site which you can then edit/load in your favourite IDE. You still need to press the publish button, but it cuts out the copy/paste part!
For "static" files such as CSS, I set them not to publish and use the linked file as the CSS file included in all pages, that way I can edit in my IDE or in MT admin.
There's a tip I saw somewhere, I forget now... It said that for the Stylesheet template (and probably other similar static files) you could set the template's 'Output file' and its 'Link to file' to the same value. That way you can edit the file outside of MT, publish it if you want, and all should be fine.
One thing you could do is keep a copy of this handy and ready to go in a SSH session on your MT host. Looks like a pretty nifty utility for firing off a rebuild from the command line rather than going through the UI.
You can also make life easier by doing some research to see if there are any template sets that provide much of what you want. It's always easier to hack someone else's finish template set than to build your own from scratch.
Great suggestions, everyone.
I typically delete styles.css and just point to my own, non-template CSS. I even do that with a few of my own server side includes (since that's what Template Modules are anyway). I try to keep the rebuilding restricted to template tags that need rendering.
Rebuilding remotely sounds very cool. I'll for sure look in to that.
Is there a way to make those **.mtml** template files render like normal HTML in a browser? I use MAMP on a Mac, so I wonder if I can configure my local server to treat those as HTML. That way I can see preview them locally without waiting for a rebuild.
I suppose one big way speed it all up is to install a local version of Movable Type. Unfortunately I went down this path, and it gets real hairy if you want to use MySQL. Rebuilding locally would be really zippy. The downside is that I'd have to migrate everything to the remote server (which could be as easy as uploading my template files).
Thanks again and keep the suggestions coming! :)
I recently decided to take the slacker's way out and switched to MAMPP. If you're using MacOS X, I'd recommend it. It's not quite as mature as XAMPP for Windows, but they're both good. Check them out. I used to use XAMPP on Windows for developing locally for MT, and it worked like a charm.
Thanks, Mike!
I actually just tried one last time to get MT to install on MAMP, and I got it to work.
Here's an [excellent tutorial](http://www.paulmc.org/whatithink/2008/02/06/setting-up-movable-type-4-on-a-mamp-server/ "MT Install on MAMP on Mac OS X") to do so.
I suspect that now that it's running locally, I can build, customize, and test all my templates much faster (not to mention when I'm not connected to the internet). When the templates are ready, I can just push them to the remote server on a MySQL-based installation.
I've been trying to get it to install locally for quite a while. I'm stoked. :)
Just a correction on a prior post: the linked template files *don't* have to be **.mtml**. They can be anything like **.html**, **.php**, etc. (but *not* .cgi, .pm, .pl, or .cfg).
This has been a very beneficial post for me. I can now be faster by developing locally with linked template files. I foresee get a lot done a lot faster. :)
**Thanks, everyone!**