SlideShare a Scribd company logo
THE DRUPAL 8 PLUGIN
SYSTEM: EXTENSIBILITY FOR
ALL
I am , , and .Xano @BartFeenstra http://mynameisbart.com
WHAT ARE PLUGINS?
Swappable extensions that provide logic for a specific (set of) task(s)
Uniquely identifiable
Metadata
Multiple instances can co-exist (reuse)
DRUPAL 7 PLUGINS
Hook discovery (core and most contributed modules)
File-based discovery (ctools)
Magic hooks/callbacks/includes
Some plugins are classed
SAY WHAT?
DRUPAL 8 PLUGINS
Are classed. Always.
Should implement interfaces.
Consistent API for discovering and instantiating plugins, regardless of
type.
NO MORE DARK MAGIC
JARGON, DO YOU SPEAK IT?
PLUGIN TYPE
PLUGIN (DEFINITION)
PLUGIN DISCOVERY
PLUGIN FACTORY
PLUGIN MANAGER
(DISCOVERY + FACTORY + ...)
PLUGIN INSTANCE
PLUGIN CONFIGURATION
RECREATING/CLONING
PLUGIN INSTANCES
Using Plugin type/manager, ID, and configuration through
ConfigurablePluginInterface.
DISCOVERY METHODS
Annotated class discovery (mostly different logic)
YAML discovery (mostly reused logic)
Static discovery (testing)
Hook discovery (deprecated)
ANNOTATED CLASS
DISCOVERY
<?php
/**
* The plugin that handles Data response callbacks for REST resources.
*
* @ingroup views_display_plugins
*
* @ViewsDisplay(
* id = "rest_export",
* title = @Translation("REST export"),
* help = @Translation("Create a REST export resource."),
* uses_route = TRUE,
* admin = @Translation("REST export"),
* returns_response = TRUE
* )
*/
class RestExport extends PathPluginBase implements ResponseDisplayPluginInterface {
// Class contents here...
}
?>
YAML DISCOVERY
system.admin:
title: Administration
route_name: system.admin
weight: 9
menu_name: admin
system.admin_content:
title: Content
description: 'Find and manage content.'
route_name: system.admin_content
parent: system.admin
weight: -10
system.admin_structure:
route_name: system.admin_structure
parent: system.admin
description: 'Administer blocks, content types, menus, etc.'
title: Structure
weight: -8
FORMS
DERIVATIVES
One base plugin definition can be dynamically expanded into multiple
derivative plugin definitions.
THERE'S A MODULE FOR
THAT
http://drupal.org/project/plugin
PLUGIN TYPE DISCOVERY
ADMINISTRATIVE OVERVIEW
CONFIGURATION SCHEMAS
plugin.plugin_configuration.*.*
TYPED PLUGIN DEFINITION
API
Now: PluginDefinitionMapperInterface
Future: PluginDefinitionInterface
PLUGIN SELECTORS
FIELD
TYPES/WIDGETS/FORMATTER
S
CONCLUSION
EXTENDING 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)

More Related Content

PDF
The Drupal 8 plugin system: extensibility for all
PPT
Os Vanrossum
PDF
Javascript fundamentals for php developers
PDF
Java exceptions
PDF
Python簡介和多版本虛擬環境架設
PDF
Creating Layouts and Landing Pages for Drupal 8 - DrupalCon Dublin
PDF
Recipes for Drupal distributions
PPTX
Drupal 8 Plugin API - Manoj K
The Drupal 8 plugin system: extensibility for all
Os Vanrossum
Javascript fundamentals for php developers
Java exceptions
Python簡介和多版本虛擬環境架設
Creating Layouts and Landing Pages for Drupal 8 - DrupalCon Dublin
Recipes for Drupal distributions
Drupal 8 Plugin API - Manoj K

More from Bart Feenstra (8)

PDF
PHP-FIG: how the PHP world got off their islands (DrupalCamp Vienna 2015)
PDF
An Introduction to Object-Oriented Programming (DrupalCamp Leuven 2015)
PDF
The Drupal 8 plugin system: extensibility for all (Drupalaton 2015)
PDF
An Introduction to Object-Oriented Programming (DrupalCamp North 2015)
PDF
An Introduction to Object-Oriented Programming (SaunaCamp Helsinki 2015)
PDF
Entity API in Drupal 8 (Drupal Tech Talk October 2014)
PDF
Payment processing in drupal 8 (DrupalCamp Ghent 2014)
PDF
An Introduction to Object-Oriented Programming (DrupalCamp London 2015)
PHP-FIG: how the PHP world got off their islands (DrupalCamp Vienna 2015)
An Introduction to Object-Oriented Programming (DrupalCamp Leuven 2015)
The Drupal 8 plugin system: extensibility for all (Drupalaton 2015)
An Introduction to Object-Oriented Programming (DrupalCamp North 2015)
An Introduction to Object-Oriented Programming (SaunaCamp Helsinki 2015)
Entity API in Drupal 8 (Drupal Tech Talk October 2014)
Payment processing in drupal 8 (DrupalCamp Ghent 2014)
An Introduction to Object-Oriented Programming (DrupalCamp London 2015)
Ad

Recently uploaded (20)

PPTX
Slides PPTX World Game (s) Eco Economic Epochs.pptx
PPTX
522797556-Unit-2-Temperature-measurement-1-1.pptx
PPTX
innovation process that make everything different.pptx
PDF
Unit-1 introduction to cyber security discuss about how to secure a system
PDF
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
PDF
Cloud-Scale Log Monitoring _ Datadog.pdf
PDF
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
PPTX
international classification of diseases ICD-10 review PPT.pptx
PPT
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
PPTX
Job_Card_System_Styled_lorem_ipsum_.pptx
PPTX
INTERNET------BASICS-------UPDATED PPT PRESENTATION
PDF
The New Creative Director: How AI Tools for Social Media Content Creation Are...
PDF
SASE Traffic Flow - ZTNA Connector-1.pdf
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
PPTX
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
PDF
Tenda Login Guide: Access Your Router in 5 Easy Steps
PDF
Sims 4 Historia para lo sims 4 para jugar
PPTX
Digital Literacy And Online Safety on internet
PPTX
E -tech empowerment technologies PowerPoint
PDF
The Internet -By the Numbers, Sri Lanka Edition
Slides PPTX World Game (s) Eco Economic Epochs.pptx
522797556-Unit-2-Temperature-measurement-1-1.pptx
innovation process that make everything different.pptx
Unit-1 introduction to cyber security discuss about how to secure a system
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
Cloud-Scale Log Monitoring _ Datadog.pdf
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
international classification of diseases ICD-10 review PPT.pptx
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
Job_Card_System_Styled_lorem_ipsum_.pptx
INTERNET------BASICS-------UPDATED PPT PRESENTATION
The New Creative Director: How AI Tools for Social Media Content Creation Are...
SASE Traffic Flow - ZTNA Connector-1.pdf
PptxGenJS_Demo_Chart_20250317130215833.pptx
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
Tenda Login Guide: Access Your Router in 5 Easy Steps
Sims 4 Historia para lo sims 4 para jugar
Digital Literacy And Online Safety on internet
E -tech empowerment technologies PowerPoint
The Internet -By the Numbers, Sri Lanka Edition
Ad

The Drupal 8 plugin system: extensibility for all (DrupalCamp Baltics 2015)