Want to learn more about Acquia’s products, services, and happenings in the Drupal Community? Visit our site: http://bit.ly/yLaHO5.
Drupal 8 has introduced a number of new (to Drupalists) technologies, but embedded in this mix are a handful of Drupal-centric innovations. Amongst the first of these to be introduced to Drupal 8 was the Plug-in system. The Plug-in system is a far reaching PHP Component that has largely replaced the old hook_info/alter pattern within Drupal and can be used outside of Drupal as well.
In this webinar, Kris Vanderwater (You may know him as EclipseGc) will review:
• Examples of what appropriate plug-in system usages look like
• What plug-in tools exist and how to leverage them
• Where to get information on building your own plug-in types
• How to use the existing helper classes in Drupal for the greatest impact
We will compare and contrast how Drupal 7 versus Drupal 8 works for plugin converted subsystems to frame the discussion around when and why to build a conversion. In addition to this we will dig into the tools and classes Drupal provides out of the box, and dissect a simple example plug-in type that you can use to build your own plug-ins types and better understand the plug-in system.
Experience level: Advanced
3. Drupal 8 Plugins: Topics
• What is a Plugin?
• Why Plugins?
• Benefits of Plugins
• Foundational Concepts
• Implementing Plugins
• Creating your own Plugin Type
6. What is a Plugin?
Helior’s Definition: A discreet class that
executes an operation within the
context of a given scope, as a means
to extend Drupal’s functionality.
!
!
!
!
!
7. What is a Plugin?
Helior’s Definition: A discreet class that
executes an operation within the
context of a given scope, as a means
to extend Drupal’s functionality.
!
!
Kris’ Definition: A discoverable class
that implements a particular interface
which adds or extends functionality to
a pluggable subsystem.
16. Why Plugins?
• Drupal actually is kinda unique!
• Unprecedented Configurability!
• Absence of similar code
17. Why Plugins?
• Drupal actually is kinda unique!
• Unprecedented Configurability!
• Absence of similar code!
• Other CMS don’t expose as much
18. Why Plugins?
• Drupal actually is kinda unique!
• Unprecedented Configurability!
• Absence of similar code!
• Other CMS don’t expose as much!
• Frameworks expect it to be hard coded
35. Drupal 8 System Blocks!
Contents of core/modules/system/src/Plugin/Block
• SystemBrandingBlock.php!
• SystemBreadcrumbBlock.php!
• SystemHelpBlock.php!
• SystemMainBlock.php!
• SystemMenuBlock.php!
• SystemPoweredByBlock.php
36. Benefits of Plugins:
• Definition & Implementation are co-located!
• Plugins are Object Oriented!
• Plugins are Lazy Loaded by default!
• Common Pattern (Learn once, use every where)
64. Annotations:
• Annotations are NOT CODE!!
• yaml, json, {insert_serializer} are NOT CODE!!
• Annotations have more in common serialization.
65. Annotations:
• Annotations are NOT CODE!!
• yaml, json, {insert_serializer} are NOT CODE!!
• Annotations have more in common serialization.!
• Data not behavior.