blocks & layouts in d7 - josef dabernig

41
BLOCKS & LAYOUTS From Drupal 7 to 8

Upload: drupalcampdn

Post on 08-May-2015

204 views

Category:

Internet


0 download

DESCRIPTION

Drupal 7 site builders are presented with a variety of tools to create complex layouts. In this session, I will talk about our in-house tool-chain at drunomics for building sites with dynamic layouts.

TRANSCRIPT

Page 1: Blocks & Layouts in D7 - Josef Dabernig

BLOCKS & LAYOUTSFrom Drupal 7 to 8

Page 2: Blocks & Layouts in D7 - Josef Dabernig

@DASJOJosef Dabernig

Page 3: Blocks & Layouts in D7 - Josef Dabernig

http://dasjo.at/blocks-layouts-szeged

Page 4: Blocks & Layouts in D7 - Josef Dabernig
Page 5: Blocks & Layouts in D7 - Josef Dabernig
Page 6: Blocks & Layouts in D7 - Josef Dabernig

THIS IS MY FAVORITE BLOCKS & LAYOUTS RELATED MODULE

Page 7: Blocks & Layouts in D7 - Josef Dabernig
Page 8: Blocks & Layouts in D7 - Josef Dabernig

IT ALL BEGINS…

Page 9: Blocks & Layouts in D7 - Josef Dabernig

• Themes

• Regions

• Blocks

• Templates

BASICS

Page 10: Blocks & Layouts in D7 - Josef Dabernig

CORE BLOCKS

Page 11: Blocks & Layouts in D7 - Josef Dabernig

CHALLENGES

• Too much going on at admin/structure/block

• Can’t export block configuration

• Custom blocks depend on global “context” information$node = node_load(arg(2));

• Content region vs. other regions

Page 12: Blocks & Layouts in D7 - Josef Dabernig

COMPOSITION PATTERNS

Page 13: Blocks & Layouts in D7 - Josef Dabernig

• Custom blocks

• Contextual views

• EVA

• and…

COMPOSITION PATTERNS

Page 14: Blocks & Layouts in D7 - Josef Dabernig

• Custom blocks

• Contextual views

• EVA

• and…

COMPOSITION PATTERNS

• Context

• Panels

• Display suite

• and…

Page 15: Blocks & Layouts in D7 - Josef Dabernig

BLOCKS & LAYOUTS

Page 16: Blocks & Layouts in D7 - Josef Dabernig

BLOCKS & LAYOUTS

Page 17: Blocks & Layouts in D7 - Josef Dabernig
Page 18: Blocks & Layouts in D7 - Josef Dabernig

CONTEXT, DISPLAY SUITE &

PANELS

Page 19: Blocks & Layouts in D7 - Josef Dabernig

CONTEXT

• React & do something

• Conditionally place blocks

Page 20: Blocks & Layouts in D7 - Josef Dabernig

DISPLAY SUITE• Extends “manage display”

• Use custom layouts

• Define view modes

• Code fields, dynamic fields, block fields, preprocess fields

Page 21: Blocks & Layouts in D7 - Josef Dabernig

PANELS

• The most successful layout solution for Drupal 7

• Huge ecosystem, includes Page manager, “Panels Context”, Panelizer, In-place editor, CTools content plug-ins, …

Page 22: Blocks & Layouts in D7 - Josef Dabernig

PUSH ~ PULL

Page 23: Blocks & Layouts in D7 - Josef Dabernig

CONTEXT ~ PANELS, DS

Page 24: Blocks & Layouts in D7 - Josef Dabernig

PAGE VARIANTS

Page 25: Blocks & Layouts in D7 - Josef Dabernig

SELECTION RULES

Page 26: Blocks & Layouts in D7 - Josef Dabernig

LAYOUT SELECTION

Page 27: Blocks & Layouts in D7 - Josef Dabernig

CONTENT PLACEMENT

Page 28: Blocks & Layouts in D7 - Josef Dabernig

PAGE MANAGER

Page 29: Blocks & Layouts in D7 - Josef Dabernig

PANELIZER

Page 30: Blocks & Layouts in D7 - Josef Dabernig

IN-PLACE EDITOR

Page 31: Blocks & Layouts in D7 - Josef Dabernig

PANELS

• Panels everywhere (take over regions & page.tpl)

• Page manager existing pages

• Fieldable panels panes (embeddable entities)

• Field API Pane Editor (D8 in-place editing, Spark)

Page 32: Blocks & Layouts in D7 - Josef Dabernig

VIEWS CONTENT PANES

Page 33: Blocks & Layouts in D7 - Josef Dabernig

3DJH�KHDGHU0HQX

)RRWHU

'HIDXOW�VLWH�WHPSODWH��3DQHOV�

1RGH��3DQHOL]HU�IXOO�SDJH�RYHUULGH�GHIDXOW�SDQHO

�&RUH�SDJH�HOHPHQWV��EUHDGFUXPEV��WLWOH��PHVVDJHV��WDEV��KHOS�

1RGH�GLVSOD\�ZLWK�GLVSOD\�PRGHV

)LHOG�$)LHOG�%���

5HODWHG�EORFNV

*OREDO�EORFNV

/D\RXW�FRQWURO�� ����GV�OD\RXW��QRGH��������SDQHOL]HU�OD\RXW��QRGH������������SDQHOV�OD\RXW��VLWH�

'UXQRPLFV�/D\RXW�2YHUYLHZ

Page 34: Blocks & Layouts in D7 - Josef Dabernig
Page 35: Blocks & Layouts in D7 - Josef Dabernig

WSCCI + SCOTCH ≈

DRUPAL 8

Page 36: Blocks & Layouts in D7 - Josef Dabernig

• Blocks are Plugins

• Object-oriented

• Extensible

• Annotation config

DRUPAL 8

Page 37: Blocks & Layouts in D7 - Josef Dabernig

• Block library

• Custom blocktypes

• Fields, revisions& view modes

DRUPAL 8

Page 38: Blocks & Layouts in D7 - Josef Dabernig

• Place block instances

DRUPAL 8

Page 39: Blocks & Layouts in D7 - Josef Dabernig

• Twig instead of .tpl.php

DRUPAL 8

Page 40: Blocks & Layouts in D7 - Josef Dabernig

THANKS & HAPPY BUILDING

Page 41: Blocks & Layouts in D7 - Josef Dabernig

• Blocks https://groups.drupal.org/node/160144

• Introduction to Panopoly by Adrian Webb(Panels screenshots) http://prezi.com/0l_derrjnmbx/introduction-to-panopoly/

CREDITS