Please enable JS

Convert existing custom module to a feature

Have a custom module that you want to add features to?
March 23/Brian Young/Drupal 7

I write a lot of custom modules. I normally end up needing to add Features to my existing modules well after my custom module has been established. I used to manually merge my existing module with the generated Feature by renaming files and copying and pasting the generated code/files.

There is an easier way!

Make your existing module a Feature by adding the following lines to your module's info file.

  1. package = "YourFeatureGroupName"
  2. project = your_module_name
  3. version = 7.x-1.0
  4. features[features_api][] = api:2
  5.  
  6. project path = sites/all/modules/custom


RELATED POSTS


Comments/ 0


LEAVE A COMMENT

(If you're a human, don't change the following field)
Your first name.
(If you're a human, don't change the following field)
Your first name.
(If you're a human, don't change the following field)
Your first name.
But why?

My random thoughts and documentation on the various hardware and software projects that occupy my day-to-day. My only hope is that other people can benefit from my notes.

Recent posts
Categories