Tools
Before thinking about creating any type of theme the first thing you should do is ensure that you have all the appropriate tools necessary to make life easy. For my own part I always ensure that I have the following installed on my computer:-
XAMPP for Windows, XAMPP for Mac OS X (beta), XAMPP for Linux (beta) or XAMPP for Solaris. For Mac OS X users there is also MAMP. These are the ones I know and doubtless there are others so pick your favourite flavour and install it. For the uninitiated these applications create a personal server on your computer which replicates the environment you would be working in if you were working on a “live” website but you don’t have all the hassle of having to create and then FTP files or images up to the website’s server. It can all be done on your computer. You don’t even have to be connected to the web unless you need to verify external links.
The next thing you need to do is install the latest version of Textpattern into your XAMPP or MAMP install. Even this is so much simpler than installing it to a “live” site. I happen to use the latest “SVN” version but that isn’t necessary as long as it is the latest “public” release which must at the very least be 4.2.0. Now I’m specifically talking about administration themes in this article but here’s a tip – I always install two instances of Textpattern. I use one install for “administration” themes and the other for “front of site” themes because I happen to do both. This isn’t necessary but it’s something for you to think about. Using a single install for both will end up being somewhat confusing.
Now that’s really all you need unless you prefer to code outside the Textpattern environment in which case you will want a code editor. I’m not going to list any here because there are so many of them and people each have their own favourite so just go with your preference.
The whole point of this article though is to make life as simple as possible, so forget about code editors, just go and grab Stef Dawson’s (Bloke) smd_admin_themes plugin and install it into Textpattern. This is a large plugin but Stef is a clever little bugger and has a compressed version available. I would advise that you use it. If you are creating on a “live” site you may find, like Textgarden, that your site won’t install from a compressed file in which case I’m afraid you are stuck with using the uncompressed version.
One big advantage of using Stef’s plugin is that it is very easy to create and maintain several administration themes with a single Textpattern install. Switching between themes is a doddle as is creating the necessary files for a new theme.
Now just get on with it
I’m not going to try and teach you how to design. There’s no need for that if you have Stef’s plugin up and running. What I would advise is that you download and install a couple of the themes from here. With the plugin you will be able to view the .php and .css files and see how other people have gone about it. You will then be able to set up your own theme with the plugin very easily and start writing your own code.
I would suggest that you pick one of my themes and one of someone else’s. The reason for this is that you will be able to see in my theme how the .php file has been modified to take the header and navigation out of the standard table construction and re-packaged into a div / ul / li construction. You will also be able to see how I have modified the footer block to pick up a different image. In the other theme you will be able to see how it has always been done though you could look at the “classic” theme for this. Hopefully such comparisons will give you some ideas on what you can do and how to go about it.
I should point out that the only areas of the Textpattern page that you can make major modifications to via the .php file are the header and footer blocks. Everything in between is currently the realm of plugins except for styling (CSS).
A couple of things for you to take special notice of in the .php file:-
1. Right at the top of the file you will see something similar to this:-
theme::based_on('classic');
class a_bit_black_white_theme extends classic_theme
These are important lines. The first one states that the new theme is based on “classic” and this requires that the “classic” theme, or whichever one has been chosen, has to be installed on the site alongside the new theme. If it isn’t the new theme just won’t work, or if it does it won’t work properly which is just as terminal.
The next line states that the new theme, in this case “A Bit Black & White” extends the “classic” theme. Your theme name shouldn’t use caps and definitely can’t use spaces or an ampersand which is why we end up with “a_bit_black_white_theme”. It’s not unlike the URL-only titles in Textpattern except we are using underscores instead of hyphens.
2. Right at the bottom of the file is the “manifest” function and it contains lines that look something like this:-
'author' => 'thebombsite',
'author_uri' => 'http://thebombsite.com/',
'version' => '0.1',
'description' => 'A Bit Black and White admin theme',
'title' => 'A Bit Black and White',
'help' => 'http://textpattern.com/admin-theme-help',
This information is important. Firstly, it is used by Stef’s plugin to display information on the plugin’s extension page; secondly the “version” number is used to determine whether there is a newer download for you to grab. Textgarden has a special feed which the plugin uses and that feed contains information on the version number of the current download file available. The plugin compares this to the version currently installed and lets you know if it requires an update. Please ensure that you correctly fill in this information.
What you do with the PHP in between those 2 blocks is your affair.
Also, with the plugin, you can create images in your favourite graphics package and then upload them directly into your theme with a couple of clicks and once your theme is ready to go you can export the whole thing as a .zip or .gzip file ready to upload to your site for people to download. Better yet you could email it over to me and I’ll upload it here. Let’s try and make the effort to keep themes in one place. It’s makes life much simpler for everyone. :)
Of course you can do all this without the help of XAMPP, MAMP or Stef’s plugin if you so wish but if you really insist on doing it the slow way I’m not going to help you. Seems like too much hard work to me.

