DrupalTutor

Drupal Training by Zengenuity

Blog

Session Link: https://austin2014.drupal.org/session/getting-started-grunt-better-front...

Why use Grunt

  • Grunt is for automated front-end workflows.
  • Allows automation of best practices.
  • Work in small chunks of code.
  • Test and lint our code
  • Abstract front-end code with SASS

Steps

  1. Install Node.js (brew install node)
  2. Package.json: like module.info (npm init)
  3. Install Grunt (npm install grunt-cli -g)
  4. Install Grunt plugins.
  5. npm install --save-dev grunt
  6. Gruntfile.js
  7. Configure tasks
  8. Install SASS Task npm install --save-dev grunt-contrib-sass
  9. Default Task (compile SASS, etc)

Tasks / Plugins

  • Autoprefixer: adds vendor prefixes automatically
  • http://gruntjs.com/plugins
  • Watch task: automatically runs grunt for you when files change.
  • Live Reload
  • CSSmin
  • JShint
  • browserify
  • uglifyjs
  • PHP Codesniffer
  • PHP Lint
  • PHP Unit
  • Drush: call drush commands automatically
  • load-grunt-config - config with YAML
  • grunt-notify: notifications to growl or notification center on fails
  • grunt-newer: only run certain tasks on new files

What about Gulp?

  • Faster build times
  • Pipes directly between tasks with less temp files.

Session Link: https://austin2014.drupal.org/session/double-header-file-entity-and-medi...

  • Media handling is something that users expect, and competitors to Drupal have.

In Drupal 8

  • File listing - like what File Entity adds under Content in D7
  • WYSIWYG Integration - only works with images, not videos, etc.
  • Multi-upload capability by default

For Contrib in D8

  • Pluggable components for all the media handling
  • Hope to reuse them between various media library modules.
  • Non-file centric storage components (for remote media, Youtube videos, etc)

Current Problems

  • No stable 2.x release
  • WYSIWYG handling
  • overly-complex out of the box (configuring file display)
  • Usability vs Extensibility
  • Sustained maintainership

Plan for D8

  • Split up File Entity into smaller chunks.
  • File Entity and Media Entity will exist separately
  • Will try to make components work in a non-media context: Entity Embed, Entity Browser, Fallback formatter

Challenges in Drupal 8

  • External Dependencies for Contrib: Currently can't use composer for contrib.
  • Using formatters and widgets on data without any real fields
  • Files lack proper access controller
  • Typed Data and Plugins
Of Interest To: Module Developers

Session Link: https://austin2014.drupal.org/session/validation-symfony2-drupal-perspec...

  • Symfony is a set of reusable components. Drupal 8 uses 12 of these components.
  • Install with composer: "symfony/validator"

Validator Object

  • $validator = Validation::createValidator();
    $validator->validateValue('foo@bar.tld', new Email()); // Email is a constraint class

  • Combine constraints: $validator->value('wayne', array(new Length('min' => 5, 'max' => 15)), new Regex(array('pattern' => '/XXXX/'))

Pages

Subscribe to DrupalTutor Blog

Who We Are

DrupalTutor was built by Zengenuity, a Drupal development firm in Ann Arbor, Michigan. Our online courses are taught by Wayne Eaker, a Drupal expert with years of experience building highly-customized Drupal websites. Wayne's also a seasoned trainer, having taught professionals, corporate clients and high school computer science students.

Contact Us

DrupalTutor.com is a service of Bitwisdom, LLC.

Address:
116 East Washington Street, Suite 220
Ann Arbor, Michigan 48104

Web: http://drupaltutor.com
Email: info@drupaltutor.com
Phone: 734-961-4705

Contact Us Online

About Drupal

Drupal is an open source content management platform powering millions of websites and applications. This website and Drupal training are provided by Zengenuity, and they are not affiliated with or endorsed by the Drupal Project, the Drupal Association, or their trademark owners. Drupal is a registered trademark of Dries Buytaert.