Template Installer is a plugin for Movable Type that makes it easy to install new template sets for your blogs. Combined with Template Exporter plugin, this makes is very easy:
- For bloggers to share templates / widgets with others
- For designers to package, sell, and distribute template sets.
- For companies to deploy template sets to company blogs
Currently, sharing templates requires a lot of cutting and pasting, a very time consuming process. Using Template Installer it takes only a few clicks to install a partial or complete template set in your blog.
Screencast
The following screencast shows how easy it is to install new templates using Template Installer. In this example, the user chooses to install the "Default Templates", which is handy when you want to revert back to the defaults. The same process would be used to install a completly new set of templates. Click on the video below to watch:
As you can see, it is very quick and easy. As you can see from the last screen, Template Installer will back up your existing templates if they have been customized from the MT defaults.
The missing step from the above example is to upload the desired template set to the /plugins/TemplateInstaller/template_sets directory. No need to edit any files or settings. Once you have uploaded the set, it will appear as an option when you click "Install Templates" from the right side of the Manage Templates screen.
Requirements
- MT4+
- Template Refresh plugin (included with MT4)
Installation
- Download and extract the zip file, and upload the contents of 'plugins' folder to the 'plugins' directory of your Movable Type installation.
- Go to Design > Templates and then choose the "Install Templates" link from the lower right of the page.
- Choose a template set from the drop-down box, then click continue.
- View the results, then click "return to templates", and you are done.
Included Template Sets
The current version of Template Installer includes 3 template sets:
- Default Templates - These are the default templates that come with MT4. While you can also use the Template Refresh plugin to re-install these, Template Installer provides easy access to do so. This set is also a good example set to see how it works.
- Default Templates with Prefix Notation - A version of the default templates that use the new prefix notation. For example, <MTEntries> becomes <mt:Entries>, and so on. This template set will have the same output in your published blog as the default set, only the notation used is different. Note that the tags in this are not complete lowercases (it used mt:EntryTitle and not mt:entrytitle) Thank you to Marleen Zachte for creating this set and giving permission for its inclusion with this plugin!
- Page Template Only - This set will install the MT4 default "Page" template, as well as the included "Page Detail" module. This set will be useful for those upgrading from previous version of MT, since the Page template is not automatically installed on existing blogs, during the MT4 upgrade.
- 2 Column Layout Header - This set provides a replacement to the "Header" template module. The default MT4 templates use a 3-column layout. If you want to eaily change your blog to a 2-column layout, just install this template set.
- Template Installer Widget - The set includes a widget template that you can use with the MT Widget Manager to show your support and spread the word about Template Installer. It is also a good example of how Template Installer can be used to distribute and install blog widgets.
Want more template sets?
Template Installer is new, so there are currently not many template sets available. If you have template sets that you would like to share, I will post a link to them here. Please contact me using the contact link in the menu above. You should also check and post your template sets to the following page on the MT wiki: Template Sets for MT4.
Get Template Installer
Template Installer is free to MT Hacks members for commercial or non-commercial use:
Download Now:
A Feature for Plugin Developers
For certain plugins, it makes sense to distribute custom template or widgets along with the plugin code. In the past, I included a special template installer routine to help users install such templates. In future, I will be use Template Installer for this purpose, and you can too. Rather than ask users to upload your template set to the Template Installer directory and ask them to install the set, I have include a "side door" feature that can be used instead. Using this approach, the templates are stored in a sub-directory of your plugin. Then you can simply present a link to your users to install the templates. The link would look something like this:
<a href="javascript:void(0)" onclick="return openDialog(false, 'install_blog_templates', 'template_path=$your_template_path&set=$your_set_name&blog_id=$blog_id &magic_token=$magic_token&return_args=$your_return_args')">Install Templates</a>
Of course, you will likely use template tags to form this url, but the key things are to make it open a dialog, to set the "template_path" parameter to the path to your template files (relative to the mt root directory), the "set" parameter to name of your set, and you can also set the "return_args" to return the user to your plugin screen after the templates have been installed. When users click this link, they will bypass the "choose a template set" screen and your templates will be installed immediately.
How do I Export Templates for use with Template Installer?
While you could do it manually, and it wouldn't be too hard, you probably want to use the sister plugin, Template Exporter, which automates the process in a single click.
As always, thoughts and suggestions appreciated.


Comments (23)
After I installed this, my scheduled tasks cron job is throwing up the following error:
Subroutine instance redefined at /home/adders/oneman/cgi-bin/mt4/plugins/TemplateInstaller/TemplateInstaller.pl line 73.
Happens every time the job runs.
Posted by Adam
|
September 4, 2007 4:01 PM
Posted on September 4, 2007 16:01
Adam, thank you for reporting this. I have fixed this in development. Note that this is a warning, and not an error -- in other words, everything is working fine, the plugin should still work and it won't prevent your scheduled tasks from running successfully.
Posted by Mark Carey
|
September 6, 2007 7:50 PM
Posted on September 6, 2007 19:50
Yes, it was working fine. I just get an e-mail with that message every 15 mins…
Good to hear that it's fixed, looking forward to the revised version.
Posted by Adam
|
September 8, 2007 11:40 AM
Posted on September 8, 2007 11:40
I went to setup the plugin - and it appears the TemplateInstaller plugin throws an error 500 when I drop it in the plugins directory. Any thoughts as to what might cause that one? From what I can see in the logs there isn't anything too useful
Posted by Sean
|
September 14, 2007 12:17 AM
Posted on September 14, 2007 00:17
Hi Mark,
I'm getting this error when I tried to install the customized sign-in templates.
Can't call method "errstr" on an undefined value at C:\xampp\cgi-bin\cms\plugins\TemplateInstaller\TemplateInstaller.pl line 85.
Posted by br4inwash3r
|
September 18, 2007 2:03 AM
Posted on September 18, 2007 02:03
I've got an installation that's gotten caught with the missing search-results template.
I've installed the template-installer plug-in as per your instructions. But where do I install the Search Results Template file referenced on the MT4 wiki?
Thanks.
Posted by vbd | October 10, 2007 5:21 PM
Posted on October 10, 2007 17:21
Never mind. I just re-read the post and found my answer just below the video.
Thanks for the installer and the correction.
Posted by vbd
|
October 10, 2007 5:30 PM
Posted on October 10, 2007 17:30
after install this plugin i can`t publish index template!
my server write this eror:
CGI has been killed. Probably CPU, FILE or MEMORY limits have been exceeded.
Subroutine instance redefined at /home/atmocub3/public_html/cgi-bin/mt/plugins/TemplateInstaller/TemplateInstaller.pl line 73.
can i uninstall this plugin correctly?
Posted by lexxa | November 2, 2007 2:10 PM
Posted on November 2, 2007 14:10
lexxa, those two error are unrelated. Meaning that the "CGI has been killed" message has nothing to do with the "Subroutine instance" warning message. In other words, uninstalling the plugin likely won't fix your problem, as it is unlikely to be the cause.
That said, the warning message above has been fixed in the most recent version of Template Installer (v1.03). You can use the download link above to get the newest version.
Posted by Mark | November 2, 2007 2:18 PM
Posted on November 2, 2007 14:18
Dear Mark:
Thank you so much for creating this plugin. You are my Thanksgiving list of things to be grateful for.
I had the search template disapear about a month ago and it took me ALL DAY to figure out how to get it back with a ton of cutting and pasting.
I found about your plugin from the Mobable Type Forum which is also wonderful.
We're getting thousands of page reads and it would look really bad if we didn't have search.
I sent you a big Blog Hug!
Posted by lwriter
|
November 25, 2007 12:14 AM
Posted on November 25, 2007 00:14
I'm getting an error, too, that I can't figure out.
Can't call method "errstr" on an undefined value at /home/auyrrndh/public_html/x/cgi-bin/plugins/TemplateInstaller/TemplateInstaller.pl line 82.
I'm trying to use this plugin in conjunction with the AjaxComments plugin, and when I click install from there... I get the error.
Posted by justinmc
|
November 27, 2007 9:28 PM
Posted on November 27, 2007 21:28
Mm.. I'm not even getting to the "Install Templates" part. I've copied the files over to cgi-bin/mt/plugins/ (or is it (mt-static/plugins/?), (via ftp ascii transfer) but I don't see a Install templates link in the lower part of my page under Action. The only thing still there is "Create a Feed Widget"? Any ideas?
Posted by r00
|
December 4, 2007 5:03 PM
Posted on December 4, 2007 17:03
r00, make sure that you include the "TemplateInstaller" directory when you upload everything. It should look like:
cgi-bin/mt/plugins/TemplateInstaller/TemplateInstaller.pl
cgi-bin/mt/plugins/TemplateInstaller/template_sets/
...and so on...
Posted by Mark Carey
|
December 5, 2007 10:26 AM
Posted on December 5, 2007 10:26
Uh.. I don't have a TemplateInstaller.pl in the zip file..
Posted by r00
|
December 5, 2007 11:55 AM
Posted on December 5, 2007 11:55
Wait, never mind. I just downloaded it again, and it has it there now. :) It's sure to work now! I musta not unzipped everything.. weird.
Posted by r00
|
December 5, 2007 11:57 AM
Posted on December 5, 2007 11:57
Hi Mark, thanks for a popular plugin. I see "install templates" in my action menu, but when I click it I get this error: Loading template 'HASH(0xafa3ef0)' failed.
I actually bought Visitor Stats Pro for a client and I don't think I can get the widget installed without this plugin's functionality, can I? Any suggestions?
Posted by leftsider
|
December 13, 2007 8:26 PM
Posted on December 13, 2007 20:26
leftsider,
I haven't seen that error before. Does this error happen immediately after you click the "install templates" button? Is there any message on screen before that one? Have you checked your templates to see whether some/all of the templates may have been installed despite the error? Any errors in the System Activity log?
Without further information my best guess would be that the files for Template Installer (or the Visitor Stats templates) may not be in the correct locations, or a .tmpl has become corrupted.
Posted by Mark Carey
|
December 17, 2007 8:32 AM
Posted on December 17, 2007 08:32
Bryan, I just re-read your comment and now I realize you were clicking the link in the "action menu". Instead, you should go back to the Visitor Stats Pro settings and click the "Install Templates" button, that will install the templates (including the widget). Please let me know if you still get an error.
Posted by Mark Carey
|
December 17, 2007 8:35 AM
Posted on December 17, 2007 08:35
Hey, I'm getting this error: "Undefined subroutine &MT::Plugin::TemplateRefresh::default_dictionary called at /home/rnehfdw/public_html/cgi-bin/mt/plugins/TemplateInstaller/TemplateInstaller.pl line 181."
Tried deleting and then redownloading and reinstalling it -- same error message. Could this be because I'm using the most recent beta? In any case, I certainly hope it can be fixed -- so much nifty stuff depends on this plugin!
Posted by Elkins
|
January 8, 2008 4:31 AM
Posted on January 8, 2008 04:31
Hi Mark,
I'm getting the same error as Elkins
Undefined subroutine &MT::Plugin::TemplateRefresh::default_dictionary called at /nfs/scarab/home2/v/vttp/public_html/cgi-local/mt/plugins/TemplateInstaller/TemplateInstaller.pl line 181.
I am running MT4.1b2-en
I tried installing Default Templates with Prefix Notation and got this error. Any help with this is much appreciated. Thanks -tf
Posted by talaris
|
January 8, 2008 12:36 PM
Posted on January 8, 2008 12:36
Hi Mark,
Thanks for the great plugins! I've run into errors when trying to import or export global template sets in MT4.1. Is there any chance that this will be supported in the future?
Thanks!
Posted by bart | May 28, 2008 2:14 PM
Posted on May 28, 2008 14:14
Hello!
I get the same error after I upgraded to 4.21:
Undefined subroutine &MT::Plugin::TemplateRefresh::default_dictionary called at /var/www/vhosts/adg.org.es/cgi-bin/mt/plugins/TemplateInstaller/TemplateInstaller.pl line 181.
Also the navigation menu rollovers won't work in the admin backend, I can still click l on them but it takes me to the firts action of the submenu that won't show.
Does anyone know what causes this?
It happens on both Safari and Firefox (Mac or PC), but it does work on IE7...
Thanks for any help!
EU
Posted by QuiQue | October 18, 2008 5:09 PM
Posted on October 18, 2008 17:09
Thanks for any help!
q8
Posted by شات صوتي | January 20, 2010 7:44 AM
Posted on January 20, 2010 07:44