Top Banner
Drupal “Features” module Support to export/import Drupal components like Views, menus, menu items, content types, CCK fields, image cache presets, Drupal variables, permission, user roles etc. Braham Pal Singh| Jan 19, 2015
12
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Drupal features   knowledge sharing

Drupal “Features” moduleSupport to export/import Drupal components like Views, menus, menu items, content types, CCK fields, image cache presets, Drupal variables, permission, user roles etc.

Braham Pal Singh| Jan 19, 2015

Page 2: Drupal features   knowledge sharing

1. What’s the “Features” module?2. How to use “Features”?3. Features file structure4. Features state like default, overridden, need

review5. “Revert” feature components6. Supported modules7. Using “Drush” for features8. References

Agenda

Page 3: Drupal features   knowledge sharing

Features provides a UI and API for taking different site building components from modules with exportable and bundling them together in a single feature module. A feature module is like any other Drupal module except that it declares its components (e.g. views, contexts, CCK fields, etc.) in its .info file.

What’s the “Features” module?

Page 4: Drupal features   knowledge sharing

Download and install “features” module form Drupal community

Create the feature and download it. Put this feature in destination site and

install it like a module Review all the components

How to use “Features”?

Page 5: Drupal features   knowledge sharing

Features file structure

Page 6: Drupal features   knowledge sharing

Default (state):  All settings in your feature identically match their respective settings on the site.

Overridden (state):  The components of the feature used in the site no longer match the state of them in the feature module.

Needs review (state):  This is effectively the same state as overridden, but generally means there are more complicated changes and it's recommended you review the differences prior to reverting the feature.

States - default, overridden, need review

Page 7: Drupal features   knowledge sharing

State diagram

Page 8: Drupal features   knowledge sharing

“Revert” feature components

Revert (action): You can revert an overridden feature to make the site settings match those in your feature module.

Update/Recreate (action): Updating a feature is the exact opposite of reverting one, instead of reverting your site to match your feature, you'll update your feature to match your site.

Sample code:/*** Release : FRv1.2* Revert the panel to change “Baisse des prix” name to "Garanties prix bas"*/function fr_feature_catalogues_et_bons_plans_update_7002() {  features_revert(array('fr_feature_catalogues_et_bons_plans' => array(‘node‘,’ views_view’ )));} 

Page 9: Drupal features   knowledge sharing

Supported modules

Features Override Strongarm - export system Variables FTools - misc tools for Features (most functionality incorporated into Features 7.x-2.x) Features Plumber (not needed with Features 7.x-2.x) Features Extra

Page 10: Drupal features   knowledge sharing

Using “Drush” for features

Page 12: Drupal features   knowledge sharing

Thank you..question?