Templates



Introduction

Templates allow you to change the look and feel of Mojo Mail screens presented to your visitors

What are templates?

Templates are just HTML files with special tags. These tags get replaced with information they represent. Think of tags as just place holders which will be filled in later. We can change what we're going to replace the tags with depending on what we need to do. Thus, the power of templates.

How to use Templates

Depending on the template your working with, different templates have different tags that are required to be there and other tags that are optional.

Where to store your templates

By default, Mojo Mail looks for template files in the same directory as it saves its lists in, namely whatever the $FILES variable is pointed to. You can have templates read and saved in a different directory by setting the $TEMPLATES variable to whatever directory you want.

Creating a Custom List Template

The List Template has the following tags available:

required:
[mojo]
The actual text copy you'll see.

optional:
[message]
A small message, summarizing the screen

[ver]
The version of Mojo Mail.

Create a new HTML file in whatever editor you like to use, using the above tags, like this:

        <html>
         <head>
          <title>[message]</title>
          </head>
         <body> 
          [mojo]
          </body>
        </html>

Save this file and upload it to where you're saving your templates. Set $USER_TEMPLATE in your config file to the name of the file you just saved. All New lists will now use this template. To make old lists use this template as well, just delete their list template.

Creating an Admin Template

The Admin Template has the following tags available:

required:
[content]
The meat and potatoes of the screen, the actual forms and text copy you'll see

[javascript]
Many of the screens have forms that need Javascript functionality. All the javascripts needed for all of the screens will be placed wherever you place this tag, we suggest in the head of your html file. You may also place the tag in your template like so:
        <!--[javascript]-->

[admin_menu]
Menu of links of the administration screens

optional:
[list_name]
The name of your list

[list]
The short name of your list

Templates
Each screen usually has a title associated with it

[root_login_message]
If someone has logged into the list control panel with the root password, this tag will be replaced with a message that says just that.

[mojo_url]
The url of the mojo.cgi script

[ver]
The version of Mojo Mail.

Create a new HTML file in whatever editor you like to use, using the above tags, like this:

        <html>
         <head>
          <!--[javascript]-->
          <title>Templates</title> 
         </head>
         <body> 
          [admin_menu]
          <p>&nbsp;</p>
          [content]
         </body>
        </html>

Save this file and upload it to where you're saving your templates. Set $ADMIN_TEMPLATE to the name of the file you just saved. Log into a list and check out your handywork.

The Mojo Mail Magic Book Index

The Mojo Mail Magic book is Copyright © 2003 Justin Simoni