Packaging a Theme

After you've developed a Theme for SMF, you may wish to give it to someone else so they can install it themselves, or enter a contest, etc. This requires you to do a few simple things to "package" your Theme and make it installable. There are three steps - theme_info.xml, Settings.language.php, and the archive format you use to distribute it.

Customizing the theme_info.xml File
On the Theme-info.xml page you will find a sample file. It contains a few comments, and a basic outline for that theme. The elements in it all have particular meanings and uses, but most of them are just for display purposes. The name is possibly the most important thing in this file. With it you can specify the name used for your Theme (fancy that!) throughout SMF, at least by default.

The author and website are there just to clarify things, and are not actually used when displaying the name of the theme. It is still recommended that you specify them, such that people can more easily tell which Theme is which.

Both the layers and templates options are very important; but in most cases, they can be left at what you see in the example file. The layers option defines the default set of layers to display on every page, comma delimited. For example, to show the 'site' layer and then the 'main' layer, you would put 'site,main' under that option. The templates option specifies which templates should be loaded on every page view, such as 'index' or 'index,Important,Admin'. However, that is fairly advanced. In most cases, 'main' and 'index' are fine.

The based-on option is currently reserved for later use, but you can put 'default' there to specify that your Theme expects the images_url and theme_url to be set to those of the default theme. In later versions of SMF, this feature may give you the option to load missing templates from a Theme other than default, which is currently always the case.

Language Files Make the World Go Round
To make it easier to internationalize (translate) themes, their descriptions are stored in the same place other translatable things are; in the language files. Specifically, the Settings language file is used here.

There are only two important strings to be specified in the Settings language file. They are theme_thumbnail_href and theme_description. The latter is used for the description, and should be rather self-explanatory. The thumbnail URL is specified in the other one, to make it possible to use your own image filename.