blocks & layouts szeged

Post on 08-May-2015

1.035 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

BLOCKS & LAYOUTSFrom Drupal 7 to 8

@DASJOJosef Dabernig

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

THIS IS MY FAVORITE BLOCKS & LAYOUTS RELATED MODULE

IT ALL BEGINS…

• Themes

• Regions

• Blocks

• Templates

BASICS

CORE BLOCKS

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

COMPOSITION PATTERNS

• Custom blocks

• Contextual views

• EVA

• and…

COMPOSITION PATTERNS

• Custom blocks

• Contextual views

• EVA

• and…

COMPOSITION PATTERNS

• Context

• Panels

• Display suite

• and…

BLOCKS & LAYOUTS

BLOCKS & LAYOUTS

CONTEXT, DISPLAY SUITE &

PANELS

CONTEXT

• React & do something

• Conditionally place blocks

DISPLAY SUITE• Extends “manage display”

• Use custom layouts

• Define view modes

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

PANELS

• The most successful layout solution for Drupal 7

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

PUSH ~ PULL

CONTEXT ~ PANELS, DS

PAGE VARIANTS

SELECTION RULES

LAYOUT SELECTION

CONTENT PLACEMENT

PAGE MANAGER

PANELIZER

IN-PLACE EDITOR

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)

VIEWS CONTENT PANES

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

WSCCI + SCOTCH ≈

DRUPAL 8

• Blocks are Plugins

• Object-oriented

• Extensible

• Annotation config

DRUPAL 8

• Block library

• Custom blocktypes

• Fields, revisions& view modes

DRUPAL 8

• Place block instances

DRUPAL 8

• Twig instead of .tpl.php

DRUPAL 8

THANKS & HAPPY BUILDING

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

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

CREDITS

top related