Creating an Alternate MT-Notifier Request Template

For some time, users of MT-Notifier have been wondering how they could customize the request template, to provide a more unified experience for their users. Until recently, this was simply not a realistic goal. However, with version 4.1.1, you can now do just that. It still takes a bit of work, but it's easier now than it has ever been to do so, and you can do it in such a way that it's easy to revert to the default templates - an important function for just about anyone.

Before getting started, it's always important to make a backup of everything you are about to change. While most templates are changed through the Movable Type interface - and one day this might also be available - at this point, you still have to do it by using a template file. Small steps for now. So, the first thing you should do is make sure that you have a backup of the entire tmpl directory under the Notifier directory. That way, you can restore things if you need to do so. Ready? Then read on.

Within the tmpl directory, you'll find a file named request.tmpl. This is the file that handles the requests that are processed by MT-Notifier. You probably don't want to change this file, but it's important to understand what this file contains before you make any changes.

At the top of this file, you will find an include statement. It looks like this:

<mt:include name="include/header.tmpl" component="notifier">

That line simply tells Movable Type to include another file, found in the include directory and named header.tmpl, and show it first. This is important, because if there isn't a file in that directory, it will show the contents of the file found in Movable Type's include directory - this means you're going to see the Movable Type background and styles. That's why you see the Movable Type screen background when a request is sent. More on this in a minute.

After the header template is included, you will also see some other items which display messages - namely the link_name and link_url parameters (used in redirection), and perhaps most importantly the message parameter, which displays the results of the request. There are also other items, such as a confirmation message (if you have them turned on), and a copyright message. But it's that header that does most of the heavy lifting, so if you want to change things around, that's where you need to go.

First things first - you absolutely, positvely (probably) do not want to change the Movable Type header template. If you do, you will actually be changing the Movable Type file, which could affect your entire installation, and that would not be good. What you'll want to do instead would be to create a brand new file with that name (which, as a reminder, is header.tmpl), and place it in the include directory under the tmpl directory in the Notifier directory. In other words, it should look like this:

MT_HOME/plugins/Notifier/tmpl/include/header.tmpl

Once you do that, the contents of that file will override the contents of the Movable Type header template - but only when the Notifier component (that is, MT-Notifier) is running, or when the request comes in. You can try it out by simply creating a mostly empty file with the correct file name. To the file, you just need to add some simple opening tags to the document. It should look like this:

<html><body><div><div>

That gives the file everything that it needs to open all the tags in the document, but there is no styling whatsoever. When a request comes in, you will simply have a blank page, with whatever styles are applied by your browser - along with the MT-Notifier parameters. Add that document to the correct location on your server and verify that it works. Once you do, you'll see that this opens up all sorts of doors - the rest is really up to you. All you have to do now is add in whatever styling you might want from your existing site (or from some other web site).

If you decide that it isn't for you, or that you want to go back to the default, just remove the header.tmpl file from this directory - not from the Movable Type include directory - and you'll go right back to where you started. That's all there is to it!

Leave a comment

Recent Entries

A New Approach to Fighting Spam
Drew asks if MT-Approval has been updated to work with MT5 - specifically version 5.14, but since version 5.2 was…
Adventures with Joomla!
One of my longtime customers, Craig Reid, recently inquired if I could help with an issue his parents were having…
MT-Notifier defined (%hash) is deprecated error?
Alert (and long-time) MT-Notifier user Scott Yoshinaga - yes, from nemu*nemu - mentioned an error that he had been seeing…