best practice site architecture in drupal 8

35
Best Practice Site Architecture in D8

Upload: pantheon

Post on 07-Apr-2017

144 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Best Practice Site Architecture in Drupal 8

Best Practice Site Architecture in D8

Page 2: Best Practice Site Architecture in Drupal 8

Pantheon.io 2

Who Are We?

Mark Ferree

Director of Engineering

Matt Cheney

Product & Co-Founder

Page 3: Best Practice Site Architecture in Drupal 8

The Dawning of the Age of Drupal 8

168,553 sites are using Drupal 8!https://www.drupal.org/project/usage/drupal

Chapter Three has done a lot of Drupal 8 projects for a number of different clients.https://www.chapterthree.com/drupal8

Pantheon has been hosting Drupal 8 for 3+ years across 20,000+ sites!https://pantheon.io/drupal-8

3

Page 4: Best Practice Site Architecture in Drupal 8

Drupal 8: On It’s Own Terms

Drupal 8 is ready for production (and has been so for awhile)

There isn’t always “a module for that” (but the architecture makes that OK)

“Content Management Features” are A+(this makes site architecture much easier)

4

Page 5: Best Practice Site Architecture in Drupal 8

As a developer:

I never want to use Drush Make again

5

Page 6: Best Practice Site Architecture in Drupal 8

Composer for Patch Management

https://github.com/cweagans/composer-patches.git

"patches_applied": {

"remote video URLs": "https://www.drupal.org/files/issues/2728241-2.patch",

"default ref ID from logic to base fields": "https://www.drupal.org/files/issues/2731915-4.patch",

"IEF form handler": "https://www.drupal.org/files/issues/2743289-2.patch",

"Add a field formatter for the player": "https://www.drupal.org/files/issues/2803173-8.patch",

"Add AMP video player integration": "https://www.drupal.org/files/issues/2817233-4.patch"

}

Page 7: Best Practice Site Architecture in Drupal 8

As a Site Owner:

I want to ensure nobody can change configuration on production.

7

Page 8: Best Practice Site Architecture in Drupal 8

Config Read Only

https://www.drupal.org/project/config_readonly

To enable read only mode, enable this module and add this to your settings.php:$settings['config_readonly'] = TRUE;

Page 9: Best Practice Site Architecture in Drupal 8

As a Developer:

I want to have better test coverage for my Drupal code.

9

Page 10: Best Practice Site Architecture in Drupal 8

Testing Improvements

public function testSessionExpiration() {

$this->drupalGet('<front>');

$session_assert = $this->assertSession();

$page = $this->getSession()->getPage();

for ($i = 0; $i < 25; $i++) {

$page->clickLink('Link to front page');

$session_assert->statusCodeEquals(200);

}

}

}

Page 11: Best Practice Site Architecture in Drupal 8

As a Themer:

I want to hide the sidebar... but only on a few pages.

Page 12: Best Practice Site Architecture in Drupal 8

12

Page 13: Best Practice Site Architecture in Drupal 8

Twig Blocks

“Blocks are used for inheritance and act as placeholders and replacements at the same time.”- http://twig.sensiolabs.org/doc/2.x/tags/block.html

13

Page 14: Best Practice Site Architecture in Drupal 8

Twig Blocks{#

/**

* @file

* Theme override to display a 404 page.

....

*/

#}

{% extends 'page.html.twig' %}

{% block sidebar_first %} {% endblock %}

Page 15: Best Practice Site Architecture in Drupal 8

Twig Blocks

{% block sidebar_first_wrapper %} {% if page.sidebar_first %}

<aside class="column-sidebar sidebar" role="complementary">

<div class="container">

{% block sidebar_first %}

{{ page.sidebar_first }}

{% endblock %} {# /sidebar_first #}

</div> <!--/.column-sidebar-container -->

</aside> <!--/.column-sidebar -->

{% endif %}

{% endblock %} {# /sidebar_first_wrapper #}

15

Page 16: Best Practice Site Architecture in Drupal 8

Pantheon.io

Tips for Making Your Architecture Pleasurable

Page 17: Best Practice Site Architecture in Drupal 8

Pantheon.io

Dealing with the Drupal 8 Contrib Space

Page 18: Best Practice Site Architecture in Drupal 8

Pantheon.io

Best Practices for Debugging in D8

Credit: https://blog.liip.ch/archive/2016/06/20/lets-debug-drupal-8.html

Page 19: Best Practice Site Architecture in Drupal 8

Pantheon.io

Best Practices for Debugging in D8

Credit: https://knpuniversity.com/screencast/drupal8-under-the-hood/debugging

Page 20: Best Practice Site Architecture in Drupal 8

Pantheon.io

Best Practices for Debugging in D8

Credit: https://blog.liip.ch/archive/2016/06/20/lets-debug-drupal-8.html

Page 21: Best Practice Site Architecture in Drupal 8

Pantheon.io

Best Practices for Debugging in D8

Credit: https://chrome.google.com/webstore/detail/drupal-template-helper/ppiceaegogijpjodfpiimifhbnaifbnn

Page 22: Best Practice Site Architecture in Drupal 8

Pantheon.io

Best Practices for Debugging in D8

Credit: https://drupalize.me/blog/201405/lets-debug-twig-drupal-8

Page 23: Best Practice Site Architecture in Drupal 8

Pantheon.io

Best Practices for Debugging in D8

Credit: https://blog.liip.ch/archive/2016/06/20/lets-debug-drupal-8.html

Page 24: Best Practice Site Architecture in Drupal 8

Pantheon.io

Architecting the Admin

Page 25: Best Practice Site Architecture in Drupal 8

Pantheon.io

Page Layout as Architecture

25

Page 26: Best Practice Site Architecture in Drupal 8

Pantheon.io

How Do You Build It in Drupal 8?

Page 27: Best Practice Site Architecture in Drupal 8

Pantheon.io

How Do You Build in Drupal 8?

Page 28: Best Practice Site Architecture in Drupal 8

Pantheon.io

How Do You Build in Drupal 8?

Page 29: Best Practice Site Architecture in Drupal 8

Pantheon.io

Awesome Workflows in Drupal 8

Page 30: Best Practice Site Architecture in Drupal 8

Pantheon.io

How Do You Build in Drupal 8?

Page 31: Best Practice Site Architecture in Drupal 8

Pantheon.io

How Do You Build in Drupal 8?

Page 32: Best Practice Site Architecture in Drupal 8

Pantheon.io

How Do You Build in Drupal 8?

Page 33: Best Practice Site Architecture in Drupal 8

Pantheon.io

Making an Architectural Plan

33

Page 34: Best Practice Site Architecture in Drupal 8

Questions & Discussion

How is Drupal 8 Going for You?What is Easy? What is Difficult?

Page 35: Best Practice Site Architecture in Drupal 8

Thank you