« Visitor Stats for your MT4 Blogs | Main | Export Templates with Template Exporter »

Easily Install Template Sets with Template Installer

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

  1. Download and extract the zip file, and upload the contents of 'plugins' folder to the 'plugins' directory of your Movable Type installation.
  2. Go to Design > Templates and then choose the "Install Templates" link from the lower right of the page.
  3. Choose a template set from the drop-down box, then click continue.
  4. 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:

Membership required, please sign-in or register:

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.

Rate this entry:

  • Currently 4/5
  • 1
  • 2
  • 3
  • 4
  • 5
Rating: 4/5 (25 votes cast). Powered by the Ajax Rating plugin.

TrackBack

TrackBack URL for this entry:

Listed below are links to weblogs that reference Easily Install Template Sets with Template Installer:

» MT4 templates with prefix notation from Emtee blog
In Movable Type 4 a new kind of template tags has been introduced, using prefixes or namespaces. For instance <MTEntry> can now be written as <mt:Entry> or <mt:entry>. The default templates included with MT4 do however still use a... [Read More]

» Movable Type plugin: Joomsayer from What's This?
Joomsayer is a plug-in for Movable Type 4 that enables you to display quotations in a very catchy quote box. The quote is added with a new button in the editor. Joomsayer has two special features:Firstly, it displays two quote... [Read More]

» MT: перенос темплейтов (боремся с чужой жадностью) from blog.lexa.ru
Разработчики MovableType, судя по всему, предполагают, что вся работа с темплейтами должна происходить внутри интерфейса системы. В ряде сортов колбасы потребности, очевидно, нет. В частности, нет способов сделать: backup/restore только темплейтов; исп... [Read More]

» Экспорт темплейтов Movable Type from blog.lexa.ru
Как и обещал ранее, родил скрипт для упрощения работы по переносу темплейтов MT: cкачать tmpl_export_lite.pl Это не замена 97-баксового Template Exporter, а именно скрипт для легкой автоматизации работы (переносить через dump/restore не всегда удобно):... [Read More]

» Template Installer и Template Exporter — два плагина для работы с шаблонами from Movable Type
Movable Type 4, обладая одной из самых лучших реализаций шаблонов, имеет все же серьезный недостаток. Для МТ нет простой установки "тем" — theme pack. Скажем, в Wordpress вы можете найти какую-то тему оформления, распаковать архив и загрузить папку на ... [Read More]

» Movable Type Plugin: Sociotags from What's This?
Sociotags is a plug-in for Movable Type 4 that adds a list of "sociotags" to your entries. Sociotags are the little images you may have seen on various pages that let you add the page to Digg, Technorati, Del.icio.us, Slashdot,... [Read More]

» Creare Sitemap con Movable Type from MovableBlog.it
Un tutorial e due template per creare file sitemap su Movable Type 3 e Movable Type 4. [Read More]

» Hacking on MT from The Daily Grind
I’ve spent basically two days now hacking on Movable Type templates and stylesheets. Not here, sadly — The Daily Grind... [Read More]

Comments (21)

Adam [TypeKey Profile Page]:

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.

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.

Adam [TypeKey Profile Page]:

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.

Sean [TypeKey Profile Page]:

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

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.

vbd:

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?

Search Results Template Only - This template set includes only the Search Results template. Some people have been affect by a bug that has deleted the Search Results template -- if yours has gone missing, install this set to get it back.

Thanks.

vbd [TypeKey Profile Page]:

Never mind. I just re-read the post and found my answer just below the video.

Thanks for the installer and the correction.

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?

Mark:

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.

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!

justinmc [TypeKey Profile Page]:

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.

r00 [TypeKey Profile Page]:

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?

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...

r00 [TypeKey Profile Page]:

Uh.. I don't have a TemplateInstaller.pl in the zip file..

r00 [TypeKey Profile Page]:

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.

leftsider [TypeKey Profile Page]:

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?

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.

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.

Elkins [TypeKey Profile Page]:

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!

talaris [TypeKey Profile Page]:

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

bart:

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!

Post a comment

Gift idea: Buy Seinfeld DVD box set, complete 9 seasons!