Presentation is loading. Please wait.

Presentation is loading. Please wait.

How to extend and configure Drupal without user interaction or database dump By Damien Snoeck for Switzerland Romandy Drupal Group January 27, 2010 Work.

Similar presentations


Presentation on theme: "How to extend and configure Drupal without user interaction or database dump By Damien Snoeck for Switzerland Romandy Drupal Group January 27, 2010 Work."— Presentation transcript:

1 How to extend and configure Drupal without user interaction or database dump By Damien Snoeck for Switzerland Romandy Drupal Group January 27, 2010 Work done with Jeff Trudeau

2 Key Points Pros and Cons Development environment and tools Custom modules Features module

3 Pros and Cons + Ease the production server update + No database dump + No SQL diff + No core files in your code repository + Fast deployment - Need a lot of more time !

4 Files Structure

5 Dev tools Drush: command line tool sh tools/drush -c files/drushrc.php make files/Makefile drupal/ Drush Make: drush extension core = 6.x projects[] = drupal projects[drupal] = 6.15 # Advanced help projects[] = advanced_help projects[advanced_help][subdir] = "contrib" projects[advanced_help][version] = 1.2

6 Drupal Install Script 1. Reset Environment 2. Download and extract drush and drush make 3. Run drush make to create environment 4. Create symbolic links between drupal~ and drupal 5. Apply local patches 6. Other initialization tasks

7 Custom Modules Base module Define dependencies Setting Drupal variables Adding new language Use custom theme Enable/Disable default blocks Translation files *.fr.po

8 Comparison 1.Administer › User management › User settings › uncheck Require e-mail verification 2.Administer › Site configuration › Languages › Add language 3.Administer › Site Bulding › Theme › Enable theme 4.Administer › Site Bulding › Blocks › Configure a block 1. variable_set('user_email_verification', FALSE); 2. locale_add_language('fr', 'French', 'Français'); 3. global $custom_theme; $custom_theme = 'mmio_base'; 4. drupal_write_record('blocks', array('bid'=>18, 'pages'=>'admin*', visibility=>1), 'bid');

9 Custom Menu Module Use of hook_menu() $items['companies'] = array( 'title' => 'Companies', 'description' => 'List of companies', 'menu_name' => 'en-menu1', 'access arguments' => array('access content'), 'page callback' => 'companies', 'weight' => 0, 'options' => array( 'attributes' => array('title' => 'Companies'), 'langcode' => 'en' ), 'type' => MENU_NORMAL_ITEM, 'file' => 'mymodule_menu.inc.php', );

10 Features Module Can be exported as module: Content type (with image presets) Permissions Views Dependencies Feeds Integration with Drush

11 Live Demo


Download ppt "How to extend and configure Drupal without user interaction or database dump By Damien Snoeck for Switzerland Romandy Drupal Group January 27, 2010 Work."

Similar presentations


Ads by Google