Future-Proof Your Drupal 7 Site – About Me – User Interface



Future-Proof Your Drupal 7 Site – About Me – User Interface

0 0


2014-03-29


On Github davereid / 2014-03-29

Future-Proof Your Drupal 7 Site

Midcamp 2014

Dave Reid / @davereid

davereid.github.io/2014-03-29

About Me

Senior Developer at Lullabot

Twitter: @davereid

IRC: davereid

Maintain amost 2% of contrib modules

Core subsystem maintainer

Father of two cats and one boy

Objectives

For your site buildersand architects to makeinformed choices now

Ease pain of site userswhen switching to Drupal 8

User Interface

Spark Distribution

Navbar

Inline Editing

Official WYSIWYG: CKEditor

Responsive Bartik

https://drupal.org/project/responsive_bartik

HTML5

VIEWS IN CORE!

Administration Views

https://drupal.org/project/admin_views

Views Bulk Operations (light)

https://drupal.org/project/views_bulk_operations

Views Responsive Grid

Responsive Tables

Breakpoints

Responsive Pictures

Tours

Module page filtering

https://drupal.org/project/instantfilter

Simplified Menu Administration

https://drupal.org/project/simplified_menu_admin

Escape Admin

Caption Filter

https://drupal.org/project/caption_filter

<img data-align="center" data-caption="Test caption" ... />

Custom blocks (Bean)

https://drupal.org/project/bean

Field types

Entity reference

NOT Node or User reference modules

Telephone

NOT phone module

Email (lite)

URL

NOT link module

Datetime (Date lite)

For developers

APIs and Plugins
Libraries

Hooks

/**
 * Implements hook_mymodule_hook_info().
 */
function example_mymodule_hook_info() {
  $info['example'] = array(
    'label' => t('Example implementation'),
    'callback' => 'example_mymodule_callback',
    'settings form' => 'example_mymodule_form',
  );
  return $info;
}

CTools plugins

/**
 * Implements hook_ctools_plugin_directory().
 */
function example_ctools_plugin_directory($module, $plugin) {
  if ($module == 'mymodule' && $plugin == 'hook') {
    return "plugins/$module/$plugin";
  }
}

// plugins/example/hook/example_implementation.inc
$plugin = array(
  'title' => t('Example implementation'),
  'class' => 'ExampleMyModuleHookImplementation',
);

// plugins/example/hook/ExampleImplementation.class.php
class ExampleMyModuleHookImplementation {
  // Does stuff.
}

Plugins in D7

lib/MyModuleHookPluginInterface.php
class MyModuleHookPluginInterface {
  public static function getInstance($config = array());
  public function getDefaults();
  public function process($config);
}
lib/MyModuleHookPluginBase.php
abstract class MyModuleHookPluginBase extends MyModuleHookPluginInterface {
  public funciton getInstnace($config = array()) {
    $class = get_called_class();
    return new $class($config);
  }

  public function getDefaults() {
    return array();
  }

  abstract public function process($config);
}

Plugins in D7

example.module
/**
 * Implements hook_mymodule_hook_info().
 */
function example_mymodule_hook_info() {
  $info['example'] =
    'label' => t('Example implementation'),
    'class' => ExampleMyModuleHookPlugin',
  );
  return $info;
}
example.info
files[] = lib/ExampleMyModuleHookPlugin.php
lib/ExampleMyModuleHookPlugin.php
class ExampleMyModuleHookPlugin extends MyModuleHookPluginBase {
  public function process($config) {
    // Do stuff!
  }
}

The Other Stuff

Configurable view/display modes

https://drupal.org/project/entity_view_mode

CMI

Migrate is your friend

https://drupal.org/project/migrate

https://drupal.org/project/migrate_d2d

RESTful Web Services

https://drupal.org/project/restwsNOT services module

Translation

PSR-0 / PSR-4

https://drupal.org/project/xautoload

More things

Composer / Composer Manager
phpunit
Symfony
Backbone
Underscore
Guzzle
JS local storage

Things you should probably stop using

We don't want no scrubs

Thank you!Questions?