Creating and using admin-side themes TODO
Admin-side themes allow Textpattern administrators (and publishers) to choose a specific theme for the panels, from the list of options via the Admin Preferences.
The core admin-side theme options are:
- Hive (Flat Neutral)
To change the admin-side theme, go to the Preferences panel, and within the Admin section select the theme you want from the ‘Admin-side theme’ control.
Administrators can also allow account holders to choose their own admin-side theme on an individual basis, which is done by installing the smd_admin_themes plugin.
That’s all great. But it gets even better by installing your own admin-side themes and making them available via the options noted above. You can choose to add an existing admin theme, or create one of your own.
From hereon we talk about creating a new admin theme.
Creating admin themes
There are two ways to create themes: from scratch or by inheriting much of the theme code from one of the existing core admin themes. Let’s start with the basics of doing it by scratch.
Creating an admin from scratch
Your new theme will have a specific file structure and name, as well particular code patterns.
File structure and name
Every theme will be created within its own folder, which will then be uploaded to
/textpattern/admin-themes/. Thus, a theme named
foo_theme will be stored as
Your folder and the principle PHP file inside it must have a common but unique name; common in that they will be the same, but unique in that they will not share the same name with any other admin theme used in that instance of Textpattern. No name clashes allowed!
foo_theme â”œ foo_theme.php â”œ css â”” bar.css â”œ js â”” bar.js â”œ screenshot.jpg â”” README.txt
To avoid name clashes, and especially if you’re going to share your themes with the public (whether freely or at cost), we recommend that you reserve a name prefix that is thereafter (and for eternity) only used by you to prefix your themes (and plugins, should you create any). Your prefix must be three alphanumeric characters. Register your prefix by adding it to the list. Do not edit or use anyone else’s prefix!
An admin theme will draw fractions of the admin-side user interface:
Entries in the HTML
Navigation menu and other header markupheader()
**IMPORTANT**: although it's possible to completely redesign (change the
code of) the header and footer of the admin-side page, *don't do it* or
you risk breaking things.
For example, the DOM element having ID