How to integrate your module with Features

Last updated on
21 November 2016

Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites

Some information is found in API.txt (DRUPAL-6--1) in the Features folder.

Making your module support Exportables

The section "Integrating your module with the Features API" in the api above outlines the basics. The handbook page on exportable configuration explains how to make the data stored in your db tables exportable via either CTools or Entity API.

If you're working with data that involves user roles, see the handbook page on exportables and user role IDs in features

To make your variables exportable, without writing any code, you can use strongarm http://drupal.org/project/strongarm. The directions on the front page of strongarm under the heading "Updating your features from Strongarm 1.x to 2.x" cover this.

To see how other modules implement features and use strongarm, do a search for:

  • features[variable][] in .info files
  • 'export' => in .install files.
  • 'EntityAPIControllerExportable' => in .module files.

A simple test module that supported features of the example module would be a great place to start learning features

Help improve this page

Page status: No known problems

You can: