On my way to work recently, I was listing to a Drupal podcast (because I had already listened to all of my WordPress-related podcasts). The participants spent some time talking about something they called “Drupal Distributions”. This is a Drupal feature that lets a developer pre-package the Drupal CMS with a set of modules and settings to create a custom install tailored to a specific task.
Each distribution takes some set of Drupal themes and modules and packages them together with the Drupal core, along with custom installation steps, documentation, and so on. For example, one could create a distribution called “Drupal for Education”; it could have pre-configured roles and permissions for both teachers and students, and ship with additional modules that allow one to offer online courses and testing.
They went on to talk about various aspects of this feature, what was good, what still needed improvement, etc. I’m not terribly familiar with the inner-workings of Drupal, but it sounded like this feature is used to good effect, and that they had some really good ideas for how to make it better.
If you are a developer who sets up web sites for clients, then you can probably see how this would be useful. You probably have a favorite set of plugins that you typically install on your client sites. And you probably have to do it from scratch each time, installing and activitating the plugins, then visiting the settings pages and tweaking the default settings to your needs each time. There’s got to be a better way, right?
This reminded me of a tidbit that had come across the wp-hackers mailing list a few weeks ago that I had not been aware of, previously. WordPress has a sorta-kinda similar feature that allows you to customize the initial setup. It requires some time and programming, but it’s probably useful to some of you out there that deploy a lot of sites.
How does it work? Well, did you know that during the install process, WordPress looks for an additional install.php
file in the wp-content
directory? Neither did I. And did you know that several of the core install functions are ‘pluggable’? You can replace their functionality with your own, by defining them in the custom install.php
file.
All the gritty details are in the article Automating WordPress Customizations – the install.php way over at WordPress Bits.
Granted, this still doesn’t make it easy to auto-install a suite of plugins and pre-configure them all. But if you know you’re going to install a bunch of sites that need the same initial setup, it could be worth the time to use this functionality to create a custom install script. You could bundle the core WordPress, a theme, some plugins, and your custom installer. The custom install script could override some of the standard WordPress default settings, set the active theme and plugins, create custom user roles, etc.
If you have the time to listen to the podcast I mentioned at the beginning of the article, you could probably get some ideas on how this could be improved. Imagine if WordPress defined a way to set plugin dependencies, or if there was a set of standard plugin option names that you could depend on for certain things.
Have you ever used this feature? How would you use it, if you had the chance? What improvements can you think of?
Pingback: Six Revisions On Missing Features In WordPress