The document discusses using the Features module in Drupal to export common site elements like content types, views, and rules from a development site to a staging site. It notes that while manually reproducing these elements works, it is cumbersome and error-prone. The Features module addresses these issues by allowing developers to package such site elements into modules that can then be imported into other environments. The document provides an overview of the module's capabilities and limitations and related contributed modules that extend its functionality.
Salesforce Miami User Group Event - 1st Quarter 2024
features+ #dcb11
1. 2011-09-18 @ drupalcity.de
features+
„A Presentation about monsters, features and the plus“
features+ | 20110918 | drupalcity.de | Florian Latzel | http://isloesungen.de 1
13. Questions: How to cooperate with a team*?
● Working together on live?
● Working with ftp?
features+ | 20110918 | drupalcity.de | Florian Latzel | http://isloesungen.de 13
14. Questions: How to cooperate with a team*?
● Working together on live?
● Working with ftp?
● Sharing sqldumps?
features+ | 20110918 | drupalcity.de | Florian Latzel | http://isloesungen.de 14
15. Questions: How to cooperate with a team*?
● Working together on live?
● Working with ftp?
● Sharing sqldumps?
● Overwriting others' work?
*(Perhaps a distributed team)
features+ | 20110918 | drupalcity.de | Florian Latzel | http://isloesungen.de 15
18. Questions: How to handle the staging issue?
Everything works on dev. Now what?
● Install modules again on stage
●
Export Views, Rules, CT's manually from dev*
* Also possible via code for Rules[1] and Views[2]
features+ | 20110918 | drupalcity.de | Florian Latzel | http://isloesungen.de 18
19. Questions: How to handle the staging issue?
Everything works on dev. Now what?
● Install modules again on stage
●
Export Views, Rules, CT's manually from dev*
● Import them manually into stage
features+ | 20110918 | drupalcity.de | Florian Latzel | http://isloesungen.de 19
23. Questions: How to handle the staging issue?
Whats about the „unexportable“ functionality?
Reproduce manually:
● Module Settings / Configuration
● Roles and its Permissions
features+ | 20110918 | drupalcity.de | Florian Latzel | http://isloesungen.de 23
24. Questions: How to handle the staging issue?
Whats about the „unexportable“ functionality?
Reproduce manually:
● Module Settings / Configuration
● Roles and its Permissions
● And so on...
features+ | 20110918 | drupalcity.de | Florian Latzel | http://isloesungen.de 24
25. Questions: How to handle the staging issue?
Whats about the „unexportable“ functionality?
Reproduce manually:
● Module Settings / Configuration
● Roles and its Permissions
● And so on...
● Ooops, i forgot the live environment, repeat....
features+ | 20110918 | drupalcity.de | Florian Latzel | http://isloesungen.de 25
27. Conclusion
● Not a good strategy for a team...
features+ | 20110918 | drupalcity.de | Florian Latzel | http://isloesungen.de 27
28. Conclusion
● Not a good strategy for a team...
● No granularity...
features+ | 20110918 | drupalcity.de | Florian Latzel | http://isloesungen.de 28
29. Conclusion
● Not a good strategy for a team...
● No granularity...
● Mostly cumbersome work...
features+ | 20110918 | drupalcity.de | Florian Latzel | http://isloesungen.de 29
30. Conclusion
● Not a good strategy for a team...
● No granularity...
● Mostly cumbersome work...
● Hard to use repeating patterns...
features+ | 20110918 | drupalcity.de | Florian Latzel | http://isloesungen.de 30
31. Conclusion
● Not a good strategy for a team...
● No granularity...
● Mostly cumbersome work...
● Hard to use repeating patterns...
● Prone to errors...
features+ | 20110918 | drupalcity.de | Florian Latzel | http://isloesungen.de 31
32. Conclusion
● Not a good strategy for a team...
● No granularity...
● Mostly cumbersome work...
● Hard to use repeating patterns...
● Prone to errors...
● No revision history...
features+ | 20110918 | drupalcity.de | Florian Latzel | http://isloesungen.de 32
33. Conclusion
● Not a good strategy for a team...
● No granularity...
● Mostly cumbersome work...
● Hard to use repeating patterns...
● Prone to errors...
● No revision history...
● No VCS / SCM...
features+ | 20110918 | drupalcity.de | Florian Latzel | http://isloesungen.de 33
54. features: Known Issues
Lost in translation [5]...
● e.g. a field is named 'Beziehungsstatus'
● e.g. in your myfeature.content.inc
you will get: t('Beziehungsstatus')
that will be used as translation source
● but it should be t('relationship status')
● Still a open issue in Features Module [6]
● Solution: Features Export Language [7]
features+ | 20110918 | drupalcity.de | Florian Latzel | http://isloesungen.de 54
55. Drupal API: If a feature is not enough...
You know, Drupal has an API...
Create Upgrade-Path's with Drupal's update.php
● Create myfeature.install file
● Implement hook_install()
http://api.drupal.org/api/drupal/developer--hooks--install.php/function/hook_install/6
● Implement hook_update_N()
http://api.drupal.org/api/drupal/developer--hooks--install.php/function/hook_update_N/6
Perhaps you might use db_query()
or implement hook_you_name_it()
features+ | 20110918 | drupalcity.de | Florian Latzel | http://isloesungen.de 55
61. Installation Profile: myprofile.profile
/**
* Implementation of hook_profile_modules()
*
* @return
* array of modules to be required and activated
*/
function myprofile_profile_modules(){
return array(
// feature-stuff
'myfeature',
…
);
}
features+ | 20110918 | drupalcity.de | Florian Latzel | http://isloesungen.de 61
62. The Plus
● Perhaps your own Drupal Distribution?
features+ | 20110918 | drupalcity.de | Florian Latzel | http://isloesungen.de 62
63. The Plus
● Perhaps your own Drupal Distribution?
● Feature Server
http://drupal.org/project/fserver
features+ | 20110918 | drupalcity.de | Florian Latzel | http://isloesungen.de 63
64. The Plus
● Perhaps your own Drupal Distribution?
● Feature Server
http://drupal.org/project/fserver
● Drush Make
http://drupal.org/project/drush_make
features+ | 20110918 | drupalcity.de | Florian Latzel | http://isloesungen.de 64
65. The Plus
● Perhaps your own Drupal Distribution?
● Feature Server
http://drupal.org/project/fserver
● Drush Make
http://drupal.org/project/drush_make
● Drush make UI
http://drupal.org/project/drush_make_ui
features+ | 20110918 | drupalcity.de | Florian Latzel | http://isloesungen.de 65
66. The Plus
● Perhaps your own Drupal Distribution?
● Feature Server
http://drupal.org/project/fserver
● Drush Make
http://drupal.org/project/drush_make
● Drush make UI
http://drupal.org/project/drush_make_ui
● drush site-install
(in drush core >= 4.0)
features+ | 20110918 | drupalcity.de | Florian Latzel | http://isloesungen.de 66
67. The Plus
● Perhaps your own Drupal Distribution?
● Feature Server
http://drupal.org/project/fserver
● Drush Make
http://drupal.org/project/drush_make
● Drush make UI
http://drupal.org/project/drush_make_ui
● drush site-install
(in drush core >= 4.0)
● CI – Continious Integration
(with e.g. Hudson / Jenkins)
features+ | 20110918 | drupalcity.de | Florian Latzel | http://isloesungen.de 67