Features and Context Overview

2,341 views
2,225 views

Published on

Discussion and demo of current Drupal development trends focusing on the Features module solution to the Drupal migration and revision control problem.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,341
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • Different problems associated with each to include dual production and development. Don’t want to take the site offline.
  • Features and Context Overview

    1. 1. Brent Ratliff<br />Twitter: @brentratliff<br />Blog: laminarlogic.com<br />
    2. 2. Old Drupal Paradigm<br />Extend Drupal core with modules in order to add functionality<br />Modules added content types, blocks, and queries with Drupal API calls and hooks<br />Modules added site functionality including end to end workflow<br />
    3. 3. Common Site Functionality<br />Events<br />Blog<br />Forums<br />Articles<br />Videos<br />Product Views<br />Ticketing System / CRM<br />
    4. 4. “Functionality” Modules<br />Pros<br />One click install<br />Worked out of the box<br />Established workflow<br />Cons<br />Inflexible<br />Too many assumptions made<br />Required coding to change<br />Tough to customize<br />
    5. 5. CCK and Views Changed Everything<br />
    6. 6. CCK/Views Paradigm<br />Create some content types with the fields we need (text, images, videos, dates, currency, locations, etc)<br />Reference content types to content and users<br />Create nice lists of these things for display and search (Views, Node & User References)<br />Create some blocks to display when our users are interacting with these features<br />
    7. 7. Contrib<br />Module developers began contributing smaller modules made to target specific tasks<br />Sitebuilders use these lighter modules to build their desired functionality in a more custom way like assemblingLego™ blocks<br />Examples: Views plugins, specific CCK fields, Nodereference widgets, GMAP, Rules, Workflow - all geared towards a CCK/Views paradigm<br />
    8. 8. CCK/Views Functionality<br />Pros<br />Incredibly flexible<br />Only minor glue modules needed if any code at all<br />Can completely control workflow, forms, queries, lists, and display<br />Clients now get almost exactly what they want<br />Cons<br />Configuration is in the database<br />Lots of time spent on configuration clicking through the U/I<br />Portability, Version Control, Dev+Staging+Production<br />We lost the one click install<br />
    9. 9. This is great, this “feature” works exactly how I want it to.<br />
    10. 10. Oh crap, now everything’s in the database. How do I get it out?<br />
    11. 11. Options<br />Backup & Migrate Module<br />Deploy Module<br />Feeds (Feed API)<br />Custom SQL<br />Exportables – This sounds promising<br />
    12. 12. Exportables<br />Views (Export/Import UI)<br />CCK Export/Import<br />Panels 3<br />Context<br />Boxes<br />Strongarm (Drupal Variables Table)<br />Ctools – API to expose custom module vars<br />
    13. 13. Context and Features<br />Wouldn’t it be great if you could define the functionality you want your site to have, build the pieces separately, or maybe, some for now and some for later.<br />It sure would be nice if I could build a cool feature once and deploy it wherever I want by clicking a check box.<br />Or better yet, develop it offline and deploy it.<br />
    14. 14. The Features Module<br />A module that builds modules from exportables<br />Provides a UI to gather exportables related to site functionality (a feature)<br />Creates and manages .info, .module and other files<br />Custom hooks can be added<br />The best of both worlds<br />
    15. 15. Context<br />A module that allows sitebuilders to layout their site into logical sections by controlling conditions and reactions<br />Block visibility, body classes, active menus, custom plugins<br />Replaces block admin page<br />Exportable<br />
    16. 16. Context Theme Gotchas<br />Theme functions<br />hook_block<br />Menu Trees<br />Primary Links<br />preprocess_page<br />
    17. 17. Let’s take a look at an example<br />

    ×