Community Documentation

Getting started

Last updated January 31, 2013. Created by clemens.tolboom on September 17, 2009.
Edited by dumbass, neerajskydiver, anthonylindsay, batigolix. Log in to edit this page.

To get started just install and enable the features module.

The following screenshots are from a D6 install but are still valid for a D7 install.

At admin/build/features | D7: admin/structure/features you can manage installed features or create new ones.



Creating a new feature leads you through a few selections where you can add different aspects of your website related to one feature. In the end a download file is presented which you can save. The tar.gz file contains 'just' a module which can be installed onto your current working site or onto other sites. N.B. Do not make your features' titles too long. The machine name is limited to 100 characters due to the limitations of tar files. (http://drupal.org/node/1062422) If your name is too long, filenames will be truncated and the feature will not work.



When you install a feature on a site and you reconfigure some parts of the site related to one or more features the state of these features will change. You have then to decide what to do. If these changes are intentional then you should (re)export the feature and save the tarball or choose to revert to the original state.





The following paragraph does not apply for D7 as the modules are visible

When navigating to admin/build/modules the installed feature modules are not listed but their names appear in the module dependencies. This is weird at first but logical in the end. Features are managed on admin/build/features and disabling just the module has bad side effects.



Glossary

  • A feature - a module generated by Features, which stores configuration of other modules, e.g. a content type or a View, in code.
  • Default - if a feature is described as 'default', it means that the code that is running is that stored in your feature. The code is not stored in the database.
  • Overridden - a feature is overridden when a user uses the UI to make configuration changes. These changes are stored in the database, and overridewhat is stored in code.
  • Disabled - a feature is a module, and therefore must be enabled before it can be used. Otherwise, it is disabled.
  • Revert- if a feature has been overridden, it can be reverted. This means that the version in the database is destroyed and the version defined in code, in your feature, is used.
  • Update - updating an overridden feature will ensure that the version of the feature defined in code is made to match the version stored in the database.

Comments

What is the purpose of Version?

I don't understand why the user has to enter the version - it would seem Features could get the version number from the system. At first I thought this would be the version of the module created, but it seems to want a particular input, and I can't find this in the documentation.

And some explanation of the URL for update XML would be much appreciated too!

Nothing much...

I had the same question -- dug around for a while and it seems to be an undocumented future feature. See this issue and this suggestion, which is a good one.

Version is not the Drupal

Version is not the Drupal Core version. It's the module version. A Feature is a coded module, just like Views. So, it gets its own versioning.

Anthony Pero
Project Lead
Convergent Creative Web Design
http://www.convergentcreative.com/

Documentation should start with the basics

There are no basic documentation that outlines the basic features and definitions of how this module works. For instance, what does Overriden mean? Default? Disabled? Assumption can be the root of all evil.

I would be willing to do some documentation edits. However, I don't know what some of these terms mean. I myself - new to features - is really struggling with this module to get it functioning via deploying features to existing sites. Again, willing to help but lost on the basic principles.

Question

I think this is a great tool. However I have a question. Working on a site modification and I just noticed, looking at features list, many of the components must have been created by features and they list out as "overridden". I gather this means that I made changes to the components... I know that some of the content types that must be part of their components have been modified. For example the Commons Core module shows "overridden". But how can I tell what was overridden and how can I import these changes into the live site?

Drupal 7.0

I think you would re-export

I think you would re-export all the various features as new modules, then when you port them to the live site, install those new features modules.

Anthony Pero
Project Lead
Convergent Creative Web Design
http://www.convergentcreative.com/

Oh... ok. I see now that the

Oh... ok. I see now that the ones on the original site are listed as overridden as well. So I guess I'll just have to export whatever features are obviously changed. Well it will help a lot anyway.

Drupal 7.0

If they are existing modules

If they are existing modules on the site, yo "update" them, the same way you would any other module... Simply replace them in them in the module folders. I'm not sure, but I don't thing you need to run update.php, because features don't save anythign in the database, but I may be misunderstanding that, and it doesn't hurt to run update.php anyway.

Anthony Pero
Project Lead
Convergent Creative Web Design
http://www.convergentcreative.com/