Features
a better way to package stuff


         Rob Knight
     NWDUG February 2010
About me

‣ Drupal developer since version 4.6
‣ Member of the Drupal Association -
  you should be too!
‣ Working in Manc...
Intro
‣ Features is a Drupal module created
  by Development Seed
‣ It enables ‘Features’ to be created
  which package CC...
What is a Feature?

‣ A Feature is a special kind of module
‣ Features consist of generated code
‣ Features are created vi...
How a Drupal installation changes

                             Version
     Level      Changes
                          ...
The difference Features make
Example: Packaging
     a blog Feature

‣ ‘Blog Post’ content type
‣ Some views
‣ A Context for displaying blocks
A content type
A simple view
A context
The resulting blog


                 Text




Here we can see the blog content type,
  the context and the view in action
Creating a Feature
Creating a Feature
Creating a Feature
Feature contents
Generated code
Installing the Feature




When the Feature is enabled, all module
  dependencies will be enabled too
Changes




If any component of the feature is changed, the
     Feature is ‘overridden’. In this case, I’ve
             ...
Viewing a ‘diff’




  I can now choose to revert the
changes or update the Feature code
Version control


‣ Because Features are code, they can
  be managed like source code
‣ Updating a Feature is just like
  ...
Deployment

‣ Features are great for ‘additive’
  changes
‣ Not so great for ‘destructive’ changes
‣ Complex changes betwe...
Feature Servers

‣ Imagine running your own
  drupal.org-style module repository
‣ Supports “Available Updates”
  monitori...
What features doesn’t do
         (yet)
‣ Taxonomy
‣ Node content and attachments
‣ Menus


‣ However, alternatives exist ...
Pitfalls

‣ Many contrib modules as yet
  unsupported
‣ Features isn’t magic - it’s just a
  system for generating code
‣ ...
Questions and Answers
Thanks for listening

‣ Features is maintained by Development
  Seed and is available at
  http://drupal.org/project/featu...
Upcoming SlideShare
Loading in …5
×

Features: A better way to package stuff in Drupal

3,891 views

Published on

Rob Knight's presentation to the North West Drupal User Group in Manchester on February 18th 2009.

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,891
On SlideShare
0
From Embeds
0
Number of Embeds
464
Actions
Shares
0
Downloads
10
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • Features: A better way to package stuff in Drupal

    1. 1. Features a better way to package stuff Rob Knight NWDUG February 2010
    2. 2. About me ‣ Drupal developer since version 4.6 ‣ Member of the Drupal Association - you should be too! ‣ Working in Manchester at PRWD
    3. 3. Intro ‣ Features is a Drupal module created by Development Seed ‣ It enables ‘Features’ to be created which package CCK types, Views, Contexts and more ‣ It moves configuration from the database to code
    4. 4. What is a Feature? ‣ A Feature is a special kind of module ‣ Features consist of generated code ‣ Features are created via the admin UI ‣ Features have version numbers
    5. 5. How a Drupal installation changes Version Level Changes control? Core Rarely Yes Contrib Regularly Yes Custom code Frequently Maybe Database Constantly No Problem: how to manage change in the database?
    6. 6. The difference Features make
    7. 7. Example: Packaging a blog Feature ‣ ‘Blog Post’ content type ‣ Some views ‣ A Context for displaying blocks
    8. 8. A content type
    9. 9. A simple view
    10. 10. A context
    11. 11. The resulting blog Text Here we can see the blog content type, the context and the view in action
    12. 12. Creating a Feature
    13. 13. Creating a Feature
    14. 14. Creating a Feature
    15. 15. Feature contents
    16. 16. Generated code
    17. 17. Installing the Feature When the Feature is enabled, all module dependencies will be enabled too
    18. 18. Changes If any component of the feature is changed, the Feature is ‘overridden’. In this case, I’ve changed a View
    19. 19. Viewing a ‘diff’ I can now choose to revert the changes or update the Feature code
    20. 20. Version control ‣ Because Features are code, they can be managed like source code ‣ Updating a Feature is just like updating a module
    21. 21. Deployment ‣ Features are great for ‘additive’ changes ‣ Not so great for ‘destructive’ changes ‣ Complex changes between Feature versions are still tricky
    22. 22. Feature Servers ‣ Imagine running your own drupal.org-style module repository ‣ Supports “Available Updates” monitoring ‣ Powerful integration with drush and drush make
    23. 23. What features doesn’t do (yet) ‣ Taxonomy ‣ Node content and attachments ‣ Menus ‣ However, alternatives exist and more modules are integrating with Features
    24. 24. Pitfalls ‣ Many contrib modules as yet unsupported ‣ Features isn’t magic - it’s just a system for generating code ‣ Upgrades still need some manual intervention
    25. 25. Questions and Answers
    26. 26. Thanks for listening ‣ Features is maintained by Development Seed and is available at http://drupal.org/project/features ‣ My site & blog are at http://robknight.org.uk

    ×