Skip to content

Instantly share code, notes, and snippets.

@balintbrews
Last active December 17, 2015 12:19
Show Gist options
  • Save balintbrews/5608463 to your computer and use it in GitHub Desktop.
Save balintbrews/5608463 to your computer and use it in GitHub Desktop.
Ever happened to you that you were working on a custom module and realized you wanted to turn it into a feature, so that you can export Features components into it?

How to turn your custom module into a feature?

Ever happened to you that you were working on a custom module and realized you wanted to turn it into a feature, so that you can export Features components into it? Fortunately, it's fairly simple!

  1. Add this line to yourmodule.info:
    features[features_api][] = api:1

  2. Create a file called yourmodule.features.inc.

  3. Add this line at the beginning of yourmodule.module:
    include_once 'yourmodule.features.inc';

  4. Clear your cache.

  5. That's it, Features will now recognize your module!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment