Features | Drupal 8


Submitted by editor on Tue, 07/12/2016 - 11:54

Features is a drupal contrib module enables the capture and management of features in Drupal, by providing a UI and API for taking different site building components from modules with exportables and bundling them together in a single feature module. A feature created by the 'Features module' can be checked, updated, or reverted programmatically.

In Drupal 7, Strongarm module allows to export/import/edit drupal variables. In Drupal 8, It is included with core modules.

Create features with Features Builder

The drupal contrib module allow to build features automatically.
Module : https://www.drupal.org/project/features_builder

Organize your Features

 - blocks/
 - content_types/
 - env/
 - feeds/
 - menus/
 - permissions/
 - roles/
 - settings/
 - taxonomy/
 - views/


Also visit : Organize the Features on Drupal

Detailing structure (Example)

 - blocks/
    #Create a feature per block or a blocks group, Ex:
    - site_fs_block_header/
    - site_fs_blocks_menu/
 - content_types/
    #Create a feature per content type
    #Do not add field base, field group and field instance to the content type feature
    - site_fs_ct_article
    - site_fs_ct_basicpage
 - menus/
    #Preferancely, Create one feature per menu or one per group of menu if they contains just 2/3... itmes. Do not add other settings
    - site_fs_menu_main
    - site_fs_menu_footer
    - site_fs_menu_mymenu
 - permissions/ (and roles)
    #You can create one feature for all permissions or split as you want
    - site_fs_permissions/
     #You can create one feature for all roles or split as you want
    - site_fs_roles/
 - settings/
    #Group all your settings by catagory, Ex:
    - site_fs_ckeditor/        #With ckeditor frofiles, settings ...
    - site_fs_dependencies/    #dependencies: Modules and also features
    - site_fs_field_base/    #Basic fields settings
    - site_fs_lang_fr/        #Language settings Ex : French
    - site_fs_site_settings/#Other settings of the site
    - site_fs_user/            #User settings
    - site_fs_worklow/        #Other modules settings Ex: Workflow ...
    - site_fs_linkit_prof/    #Linkit Profiles
    - site_fs_pathauto/        #Pathauto settings
    - ...
 - taxonomy/
    #Preferancely, Create one feature per vocabulary but you can arrange as you want.
    - site_fs_taxo_tags
    - site_fs_taxo_all ...
 - views/
    #Create one feature per view, do not include any other settings the views
    - site_fs_view1
    - site_fs_view2 ...



Create and update features via DRUSH (Drupal 7)

1. Update a feature
drush fu

2. Get features components list
drush fc
then select the components

3. Add a components, Export / update a feature
drush fe the_feature field_base:field_myfield -y

4. Revert a feature
drush fr THE_FEATURE

5. Revert all features
drush fra -y
Options --force

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.