Fran García-Linares
March 2018
fran.garcia@amazeelabs.com
Fran García-Linares, Drupal web developer
fjgarlin@gmail.com
https://www.drupal.org/u/fjgarlin
1
2
Intro (5 min)
Useful modules (30~35 min)
Wrap up / Q & A (5 min)
3
To code or not to code? Site building vs back-end vs front-end.
Over-simplification:
Back end = (mostly) coding
Front end = (mostly) coding
Site building = (mostly) clicking
This is really powerful
We'll focus mostly on this today.
What do you need when you're building your new site?
Time savers
Modules, modules, modules...
*Environments
What do you need when you're maintaining your site?
Bug fixing, (security) updates, extensions
Deployment?
*Environments
Environments
Depends on:
- Size of project
- Size of company
- Level of knowledge/skills of the team
Options:
- Production
- Development > production
- Local > development > production
- Local > development > staging > production
*Most of these modules have D7 and D8 versions.
https://www.drupal.org/project/environment_indicator
// Environment indicator.
$config['environment_indicator.indicator']['bg_color'] = '#02921d';
$config['environment_indicator.indicator']['fg_color'] = '#ffffff';
$config['environment_indicator.indicator']['name'] = 'Local';
https://www.drupal.org/project/backup_migrate
https://www.drupal.org/project/stage_file_proxy
$conf['stage_file_proxy_origin'] = "http://www.exped.com";
https://www.drupal.org/project/mask_user_data
Other services / modules?:
drush sql-sanitize
https://www.drupal.org/project/devel
https://www.drupal.org/project/devel (not a typo)
DevelMailLog
Make sure that emails are not sent when testing*:
Other:
$config['system.mail']['interface']['default'] = 'devel_mail_log';
$config['devel.settings']['debug_mail_directory'] = 'temporary://mail_log';
$config['devel.settings']['debug_mail_file_format'] = 'pattern-%to-%subject-%datetime.mail.txt';
/**
* Implements hook_mail_alter().
*
* Don't send any mail in development.
*/
function custom_mail_alter(&$message) {
if (getenv('ENVIRONMENT') !== 'production') {
$message['send'] = FALSE;
}
}
* I learnt this the hard way... nearly 1K emails went out!
https://www.drupal.org/project/devel (not a typo)
https://www.drupal.org/project/features
https://www.drupal.org/project/config_readonly
Not to be confused with:
https://www.drupal.org/project/coffee
https://www.drupal.org/project/dropguard
<?php
/**
* @file
* AmazeeIO Drupal 7 local development environment configuration file.
*
* This file will only be included on local development environemnts.
*/
$conf['googleanalytics_account'] = 'UA-XXXXXXXX-Y';
$conf['theme_debug'] = TRUE;
# caching and aggregation off
$conf['preprocess_css'] = FALSE;
$conf['preprocess_js'] = FALSE;
$conf['cache'] = 0;
$conf['cache_lifetime'] = 0;
# enable developer modules
$conf['devel_enable'] = TRUE;
$conf['devel_themer_enable'] = TRUE;
# display all error messages
$conf['error_level'] = 2;
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
# intercept emails using Devel
$conf['mail_system'] = array(
'default-system' => 'DevelMailLog',
);
# other settings
$conf['stage_file_proxy_origin'] = "...";
$conf['mandrill_api_key'] = "testKeySoNoEmailsGoOut";
...
<?php
/**
* @file
* Local development override configuration feature.
*/
$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml';
$config['system.logging']['error_level'] = 'verbose';
$config['system.performance']['css']['preprocess'] = FALSE;
$config['system.performance']['js']['preprocess'] = FALSE;
$settings['cache']['bins']['render'] = 'cache.backend.null';
$settings['rebuild_access'] = TRUE;
...
D7
D8
$conf vs $settings
https://anavarre.net/from-conf-to-config-and-settings-in-drupal-8/
https://www.drupal.org/project/rules
Conditional actions based on events
It's a replacement for the trigger module in core
Allows functionality to be re-used via components
Help needed for D8 stable version: http://d8rules.org/
https://www.drupal.org/project/paragraphs
https://www.drupal.org/project/bricks
https://www.drupal.org/project/field_group
https://www.drupal.org/project/field_collection
Organise fields and create layouts instead of having everything created via CKEditor
https://www.drupal.org/project/webform
https://www.drupal.org/project/bootstrap
Drupal meets Bootstrap Framework.
https://www.drupal.org/project/omega
https://www.drupal.org/project/entity_translation
https://www.drupal.org/project/tmgmt
It does not make i18n or any other language module obsolete. It only facilitates the translation process.
https://www.drupal.org/project/domain
Running several sites from one installation
Single shared database
Share users, content, and configurations
Decoupled approach!?
API-first initiative
https://www.drupal.org/project/commerce
Commerce Kickstart Drupal distribution
eCommerce websites and applications
Leveraging Views and Rule
No hard-coded assumptions about your business model
Create product types with custom attributes
Dynamic product displays
Order management, line item
Payment method API
Tax calculation / VAT support
Discount pricing rules
That was some list! But you're missing...
Instead of this you could use that...
There is a module for (almost) everything
https://slides.com/fjgarlin