February 03, 2005

An Overview of the MT Program File Directories

What do all these folders do?

This tutorial is written by LMT guest author Arvind Satyanarayan of Movalog.

There are several folders in the default distribution of Movable Type. This tutorial will attempt to guide you through them all so that you feel more comfortable with what they do and contain.


This directory contains perl libraries and files that support Movable Type. These are the modules that are needed by Movable Type to run (for example those modules listed in mt-check.cgi are normally found here) Some plugins also require some special perl modules to be installed, and normally you can install these perl modules into the extlib/ directory. For example, the BlogTimes plugin requires the GD perl module to be installed. Obviously you can get your host to install it and then that module would be available server wide. However, if you uploaded the files provided on the BlogTimes page into your extlib/ directory, you would have the GD module installed just for your installation without having to go to your host.

The extlib/ directory, however, can't handle everything. Many modules still need to be installed by your host for example Image::Magick or the Storable module can't be installed into the extlib/ directory as they require compilation.

You should never have to change the contents of files located in this directory if you ever apply a hack.


This contains your core Movable Type files. These files are Movable Type, they are what run the different processes for example rebuilding, commenting etc. Everything you see in the Movable Type interface and everything that Movable Type does is defined here in perl. Within lib/, we have a few more directories.


This subdirectory inside lib/ contains the MT API and several subdirectories that directly control Movable Type. The files in lib/MT/ are known as the MT API (or Application Program Interface). These files allow things to interact with Movable Type and its database, this includes the actual core MT files or a desktop client like w.bloggar.


The most important directory is App/. The App/ directory contains perhaps the most important files in Movable Type. These files define Movable Type and how it works. Most of your hacks will be changing the files in this directory. It also contains default-templates.pl, as the name suggests, this file is called and its values define the default templates when you either create a new blog or reset templates in an existing blog.


As the name suggests, this folder contains the perl module responsible for all physical files generated by MT whether it be static entry pages, templates or HTML files generated by selecting the popup attribute in the upload dialog. Changes to this file will affect the files generated by MT.


L10N (or l10n as you mostly see it as) is another way of saying localization -- the term l10n is formed by the first and last letter of the word and the number of letters in between. This directory contains all your language modules used when building the MT interface. For example the English distribution of Movable Type will contain en_us.pm that will render the Movable Type interface in English.


The files and folders under this directory allow MT to interact with its database. In the default installation, you have modules allow MT to interact with Berkely DB, mySQL, PostgreSQL and SQL::Lite. If you wanted to use another database, the first thing you would need to do is create a file in this directory to correspond to your database type.


The name of this folder gives you a clue to what it does. The file in here defines the template tags available by default in Movable Type. If you wanted to add a tag into MT without writing a plugin, you would need to do it here.


This folder may not exist on your server and will need to be created if you ever install a plugin.


This folder contains files used during mt-load.cgi to create the database, tables, relationships etc. Again if you wished to have MT interact with another database, you would need to create a schemas to load the MT database into it.


As the name suggests, this folder contains the templates used by MT when a search is performed. You can learn more about using search templates here


This folder contains scripts that can be run outside of MT to interact with MT. An example would be the run-periodic-tasks file. This file can be used in a cron command to run the scheduling posting script. Similarly other scripts can be cronned and used.


This folder contains some sample plugins by Ezra that basically highlight the new plugin architecture in Movable Type 3.


This directory contains all the PHP files for the dynamic templating system introduced in Movable Type 3.1. Within it there are three folders, extlib/, lib/ and plugins/ and function exactly as their perl counterparts. extlib/ contains the Smarty templating and other PHP files to create a PHP instance of Movable Type and interact with the database. The lib/ directory contains all the PHP ports of the template tags while the plugins/ directory will contain PHP plugins.


This directory contains html files and images that is basically your copy of the MT Manual. Its pages are referenced throughout MT with the little Question Mark in a box. If you have installed MT in your cgi-bin/ you will need to move this folder out of it, in a StaticWebPath.


This directory contains images used by MT in the web based interface (mt.cgi) This will also need to be in your StaticWebPath if you have installed MT in your cgi-bin/

Has this tutorial been helpful? Please consider linking to Learning Movable Type at http://learningmovabletype.com/ . Thanks!

Posted by Arvind Satyanarayan on February 03, 2005 to Install
Comments(1) | Email to a friend | Printer-friendly version


If you would like to send a trackback
please use the following URL: http://learningmovabletype.com/cgi-bin/mt32/mt-tb.cgi/396


Hi Elise,

thank you very much for your wonderful tutorials. I'm totally new to the world of MT but already thrilled. At the moment I reorganize my webwork and bundle it under one domain. I was searching for the right tool to do so and found it in MT. I've read all through your Installing MT and Beginner Tips tutorials and now I'm well briefed for that upcoming work.

Greetings from Salzburg, Austria *Engelbert*

Post a comment

(Before posting a comment please see the Comments and Trackbacks Policy. Do you need help troubleshooting your weblog? Please post questions and requests for support at the MT Support Forums. Thanks!)

Remember Me?

(you may use HTML tags for style)

Email to a friend

Email this article to:

Your email address:

Message (optional):