The Drupal 8 plugin system: extensibility for all

25
THE DRUPAL 8 PLUGIN SYSTEM: EXTENSIBILITY FOR ALL I am , , and . Xano @BartFeenstra http://mynameisbart.com

Transcript of The Drupal 8 plugin system: extensibility for all

Page 1: The Drupal 8 plugin system: extensibility for all

THE DRUPAL 8 PLUGINSYSTEM: EXTENSIBILITY FOR

ALLI am , , and .Xano @BartFeenstra http://mynameisbart.com

Page 2: The Drupal 8 plugin system: extensibility for all

WHAT ARE PLUGINS?Swappable extensions that provide logic for a specific (set of) task(s)Uniquely identifiableMetadataMultiple instances can co-exist (reuse)

Page 3: The Drupal 8 plugin system: extensibility for all

DRUPAL 7 PLUGINSHook discovery (core and most contributed modules)File-based discovery (ctools)Magic hooks/callbacks/includesSome plugins are classed

Page 4: The Drupal 8 plugin system: extensibility for all

SAY WHAT?

Page 5: The Drupal 8 plugin system: extensibility for all

DRUPAL 8 PLUGINSAre classed. Always.Should implement interfaces.Consistent API for discovering and instantiating plugins, regardless oftype.

Page 6: The Drupal 8 plugin system: extensibility for all

NO MORE DARK MAGIC

Page 7: The Drupal 8 plugin system: extensibility for all

JARGON, DO YOU SPEAK IT?

Page 8: The Drupal 8 plugin system: extensibility for all

PLUGIN TYPE

Page 9: The Drupal 8 plugin system: extensibility for all

PLUGIN (DEFINITION)

Page 10: The Drupal 8 plugin system: extensibility for all

PLUGIN DISCOVERY

Page 11: The Drupal 8 plugin system: extensibility for all

PLUGIN FACTORY

Page 12: The Drupal 8 plugin system: extensibility for all

PLUGIN MANAGER(DISCOVERY + FACTORY + ...)

Page 13: The Drupal 8 plugin system: extensibility for all

PLUGIN INSTANCE

Page 14: The Drupal 8 plugin system: extensibility for all

PLUGIN CONFIGURATION

Page 15: The Drupal 8 plugin system: extensibility for all

RECREATING/CLONINGPLUGIN INSTANCES

Using Plugin type/manager, ID, and configuration throughConfigurablePluginInterface.

Page 16: The Drupal 8 plugin system: extensibility for all

DISCOVERY METHODSAnnotated class discovery (mostly different logic)YAML discovery (mostly reused logic)Static discovery (testing)Hook discovery (deprecated)

Page 17: The Drupal 8 plugin system: extensibility for all

FORMS

Page 18: The Drupal 8 plugin system: extensibility for all

THERE'S A MODULE FORTHAT

http://drupal.org/project/plugin

Page 19: The Drupal 8 plugin system: extensibility for all

PLUGIN TYPE DISCOVERY

Page 20: The Drupal 8 plugin system: extensibility for all

ADMINISTRATIVE OVERVIEW

Page 21: The Drupal 8 plugin system: extensibility for all

CONFIGURATION SCHEMASplugin.plugin_configuration.*.*

Page 22: The Drupal 8 plugin system: extensibility for all

TYPED PLUGIN DEFINITIONAPI

Now: PluginDefinitionMapperInterface

Future: PluginDefinitionInterface

Page 23: The Drupal 8 plugin system: extensibility for all

PLUGIN SELECTORS

Page 24: The Drupal 8 plugin system: extensibility for all

FIELDTYPES/WIDGETS/FORMATTER

S

Page 25: The Drupal 8 plugin system: extensibility for all

CONCLUSIONEXTENDING DRUPAL HAS NEVER BEEN EASIER.

Review this presentation at .http://slideshare.net/bartfeenstra

Find the Plugin module at .http://drupal.org/project/plugin

I am , , and .Xano @BartFeenstra http://mynameisbart.com

DO YOU HAVE ANY QUESTIONS?

© subsetsum @ Flickr (CC BY-NC-ND 2.0)