An introduction to features and how to keep your site configuration in code helping you and your team during development and making maintaining a site a breeze
Using features/
exportables in production
@drupalvolcon Antwerp April 20, 2010
Stijn De Meyere @stijndm www.sken.be VILLAVISCOM
Stijn De Meyere
freelance drupal dev as villaviscom.be
working closely with nascom.be
@stijndm
sken.be
Stijn De Meyere @stijndm www.sken.be VILLAVISCOM
The problem
Development local/online
Staging
Production
Stijn De Meyere @stijndm www.sken.be VILLAVISCOM
The problem
Different databases
No version control
Did we do that?
Stijn De Meyere @stijndm www.sken.be VILLAVISCOM
Solution
As much settings as possible in code
Stijn De Meyere @stijndm www.sken.be VILLAVISCOM
Features
drupal.org/project/features
Stijn De Meyere @stijndm www.sken.be VILLAVISCOM
Features
Allows you to export settings that live in the
database to code
A feature is a module, but more
Stijn De Meyere @stijndm www.sken.be VILLAVISCOM
Features: exportables
Strongarm (variables)
Permissions
Context
Imagecache
Views
Content (node + cck)
Set dependencies
Stijn De Meyere @stijndm www.sken.be VILLAVISCOM
Features extra
drupal.org/project/features_extra
Taxonomy (vocabularies)
Nodequeue
Blocks
Stijn De Meyere @stijndm www.sken.be VILLAVISCOM
Fun and easy
Easy creation
Easy additions
Diff (drupal.org/project/diff)
Easy maintenance with Drush (drush features-
update [feature-name] (drupal.org/project/
drush)
Acts as a module (because it is a module)
Stijn De Meyere @stijndm www.sken.be VILLAVISCOM
Fun and easy
Except the first export
Oh, and don’t forget ...
What to do whith stuff already in code?
Stijn De Meyere @stijndm www.sken.be VILLAVISCOM
When is a module a
feature
When the .info file has one of these:
features[context][] =
features[variable][] =
features[user][] =
features[node][] =
features[views][] =
Stijn De Meyere @stijndm www.sken.be VILLAVISCOM
Why is this important
Stijn De Meyere @stijndm www.sken.be VILLAVISCOM
Why is this important
All (most of) our settings are in code
Source control
Easy deployment (upload, revert)
Operate and support
Getting rid of thix (and minimizing
template.php)
Stijn De Meyere @stijndm www.sken.be VILLAVISCOM
Display Suite
Has features support, but not for individual
objects
Individual display and fields export
(settings are in variables)
Stijn De Meyere @stijndm www.sken.be VILLAVISCOM
Formatters
Custom CCK formatters, hand coded or with
the help of drupal.org/project/
custom_formatters
Stijn De Meyere @stijndm www.sken.be VILLAVISCOM
Feature server
fserver
Stijn De Meyere @stijndm www.sken.be VILLAVISCOM
Fserver
code.developmentseed.org/featureserver/
node/163
Make you site act as a module/feature server
Update notifications
Automated release in combination with
Project module (drupal.org/project/project)
Stijn De Meyere @stijndm www.sken.be VILLAVISCOM
Fserver examples
fserver.nascom.be/
fserver.pronovix.net/
Stijn De Meyere @stijndm www.sken.be VILLAVISCOM