1

Any guidelines on how to use features module as building blocks for a consolidated drupal site from a prototypic approach, so that most of the functionality is just a plug and play using feature.

I am afraid my question might be too broad to answer, but looking for initial pointers basically the important things need to be taken into account while building features so there can be least chances of conflicts.

2

Some of my thoughts coming from my experience:

  • Features should be logical and separated functionality blocks - each feature should be standalone as much as possible and there should be no overlaps to prevent one feature overriding other.
  • You can safely put your custom code in features - if you write something into your .module file (or any other that is not filled with features exports), next time you recreate the feature it will be respected and it will stay there - this fact is not so often used but it can be very helpful to achieve the first point.
  • More smaller features are easier to manage than few big ones - this is just because bigger features are more error prone when creating (e.g. you add something without noticing) and you need to inspect more code when searching for stuff.
  • It's good practice to put features in separate folder (e.g. sites/all/modules/features)
  • You can use Features Extra (https://drupal.org/project/features_extra) to export some additional entities, especially blocks.
  • Use Context (http://drupal.org/project/context) or Panels (https://drupal.org/project/panels) for powerful exportable layouts.
  • Everything can be exported only once, features UI will not even allow to export duplicities.
  • Use drush to make your life easier (see drush help, section features)
  • Use Advanced Options to replace your existing features when recreating (instead of downloading it and copying it manually)
  • Keep everything clean 1 - install Diff (https://drupal.org/project/diff) to see overrides of your features code and revert when necessary.
  • Keep everything clean 2 - recreate you features often, to keep your code updated and to avoid unclear situations when you are not sure what should be in code, what actually is in code and what is overriden in database.

I will update my answer when I come up with additional stuff

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.