Slides from presentation at DrupalCamp Montreal. This presentation describes the process of spinning up a pre-configured Drupal site, whether you want to write a script, create an install profile, or turn it into a distribution. The use case we'll walk though is a multilingual Drupal site, and I'll use this GitHub project as an example: https://github.com/pixelite/drupal-multilingual-starterkit.
Topics covered will include:
Writing a simple drush script
Setting up a Drupal 7 multilingual website (with zero pointing and clicking)
Planning out an install profile
Creating Drush make files to streamline contrib downloads
5. MULTILINGUAL CHECKLIST
• Enable some modules
• Add languages
• Set up language negotiation
• Pull in languages from localize.drupal.org
• Turn on the language switcher
6. MULTILINGUAL CHECKLIST
• Enable field-level translation for content types
• Add variable translations
• Enable translation for the main menu
• Set the language of menu items
• Setup pathauto patterns for each language
15. HOWTO SCRIPTTHIS?
• Create a post-install script - using drush
commands and php scripts
• Create an install profile
• Create an install profile, with make files
16. WHAT’S INTHE SCRIPT?
drush en admin_menu admin_menu_toolbar locale
l10n_update entity_translation -y
drush variable-realm-set language en site_name
"Multilingual Drupal”
drush scr create-menu-items.script
drush vset language_content_type_article 4
drush l10n-update
21. .INFO FILE
name = Multilingual Startkerkit
description = Profile for setting up a multilingual website.
core = 7.x
version = 0.1
!
;Core Dependencies
dependencies[] = block
dependencies[] = color
dependencies[] = comment
22. .INSTALL FILE
• hook_install
• add text formats
• enable blocks
• add node types
• set variables
• create fields and field instances
23. .PROFILE FILE
• hook_install_tasks
• array of steps for the installer
• each step corresponds to a callback function (could be
a form)
• hook_install_tasks_alter
• you can unset steps in the default process
28. USINGTHE MAKE FILES
Download the make files:
curl https://raw.githubusercontent.com/pixelite/drupal-
multilingual-starterkit/master/build-mulitilingual-
starterkit.make -o build-multilingual-starterkit.make
curl https://raw.githubusercontent.com/pixelite/drupal-
multilingual-starterkit/master/drupal-org-core.make -o
drupal-org-core.make
Run the make files using Drush:
drush make build-multilingual-starterkit.make