SlideShare ist ein Scribd-Unternehmen logo
1 von 32
Gutenberg
Extended
How to
extend and customize
the new WordPress editor
Sören Wrede
@soean
Webdeveloper
Hamburg
12+ Years WordPress
1+ Year Gutenberg
Why
Why
● Extensibility as core feature
● New possibilities
● New concepts
● Less documentation
● Work in progress
● What do we need?
Content
● Blocks
● Theme Support
● Block Templates
● Editor UI
● Data store
● Parser
Work in progress!
(Gutenberg 4.0)
Blocks
Block API
● Handbook
● GitHub Gutenberg Repository
● CSS-Tricks: Learning Gutenberg
● javascriptforwp.com Course
● create-guten-block Boilerplate
● Tuts+ Tutorial
JS: ES5 or ES6/JSX
PHP: ServerSideRender
ACF Block API
The State of ACF in a Gutenberg World
Gutenberg
Fields Middleware
by rtCamp
● Register fields for Gutenberg blocks
with a simple, declarative API.
● JS or PHP
● GitHub
Gutenberg Cloud
● Reuse across CMSs (WordPress, Drupal, …)
● Discover new blocks
● No plugin bloat, NPM
https://gutenbergcloud.org/
Extending Blocks
wp.hooks
● Hooks like in PHP
● addAction, addFilter, removeAction,
removeFilter, doAction, applyFilters ...
● Filter Block API properties and functions
● Handbook examples
● Hooks npm package
Extending Blocks
Block Style Variations API
Theme support
Theme Support
● Override block styles
● Enable opt-in features
(add_theme_support)
● Customize block options
● Apply Styles to editor
Theme Support
Wide Alignment (Opt-in)
● Classes:
○ .alignfull
○ .alignwide
Theme Support
Editor Color Palette (Customize)
● Classes:
○ has-slug-background-color // background
○ has-slug-color // Text
● disable-custom-colors // Color picker
Theme Support
Editor font Sizes (Customize)
● Class: has-slug-font-size
Theme Support
Editor Styles
● Editor Styles: Auto-prefix: .editor-block-list__block
● Support dark background themes
● Add default Styles
● Alternative: Extra stylesheet via
enqueue_block_editor_assets hook
Block Templates
Templates
● list of block items
● initial state for an editor session
● attributes and placeholder content
● per custom post type
● PHP and JS API
● Many planned additions
Handbook
Video Tutorial
Editor UI
Editor UI
● Plugins API
● Slot / Fill
● Sidebar, Toolbar, Pre-publish panel,
own Sidebar, ...
Editor UI
● Own Sidebar
● Examples
○ Yoast
○ Drop it
○ Public Post Preview
Data store
Data store
● modular pattern for organizing and
sharing data
● Redux like core principles
● Browser plugins
● Handbook
● Beyond the block - David Remer
(inpsyde.com) (+Video + Code)
● Redux with WordPress - Josh Pollock
● Efficient client data management for
WordPress Plugins - Riad Benguella
Data store
● core/data, core/nux, core/viewport,
core/editor, core/edit-post, yoast-
seo/editor, …
● registerStore('my-shop', {...})
● store.select(): Returns the state value
of the registered reducer
● store.subscribe( listener: Function ):
Registers a function called any time
the value of state changes.
● store.dispatch( action: Object ): Given
an action object, calls the registered
reducer and updates the state value.
Data store
● get current post content
● get currently selected tags/categories
● is Sidebar visible
● notify if an image block is inserted
● Rest API data (latest post, user
object, create category)
● Store / upsate own plugin data
● get Data from other plugins
● extend other plugins
Parser
Parser
● HTML structure to data structure
● Server-side parser
● Client-side parser (not replaceable yet)
● Handbook
● Compare parser
● An experimental Rust parser
(100 - 1000 times faser)
We need you!
Documentation
Code examples
Blog posts
Tutorials
...
This is the end!
Sören Wrede
@soean

Weitere ähnliche Inhalte

Was ist angesagt?

NODE JS OC Meetup 1
NODE JS OC Meetup 1NODE JS OC Meetup 1
NODE JS OC Meetup 1
eddify
 
About order form improvements
About order form improvementsAbout order form improvements
About order form improvements
Gengo
 

Was ist angesagt? (19)

Introduction to React
Introduction to ReactIntroduction to React
Introduction to React
 
How to keep Drupal relevant in the Git-based and API-driven CMS era - BADCamp
How to keep Drupal relevant in the Git-based and API-driven CMS era - BADCampHow to keep Drupal relevant in the Git-based and API-driven CMS era - BADCamp
How to keep Drupal relevant in the Git-based and API-driven CMS era - BADCamp
 
Decoupled drupal + vue.js
Decoupled drupal + vue.jsDecoupled drupal + vue.js
Decoupled drupal + vue.js
 
Modern web technologies
Modern web technologiesModern web technologies
Modern web technologies
 
Extending GWT
Extending GWTExtending GWT
Extending GWT
 
NODE JS OC Meetup 1
NODE JS OC Meetup 1NODE JS OC Meetup 1
NODE JS OC Meetup 1
 
About order form improvements
About order form improvementsAbout order form improvements
About order form improvements
 
The shift to the edge
The shift to the edgeThe shift to the edge
The shift to the edge
 
Gutenberg: You Can't Teach an Old Dev New Tricks - WordCamp Chicago 2018
Gutenberg: You Can't Teach an Old Dev New Tricks - WordCamp Chicago 2018Gutenberg: You Can't Teach an Old Dev New Tricks - WordCamp Chicago 2018
Gutenberg: You Can't Teach an Old Dev New Tricks - WordCamp Chicago 2018
 
Fixing Gaps. Strengthening the Chromium platform for content blocking
Fixing Gaps. Strengthening the Chromium platform for content blockingFixing Gaps. Strengthening the Chromium platform for content blocking
Fixing Gaps. Strengthening the Chromium platform for content blocking
 
آشنایی با تکنولوژی جدید Houdini
آشنایی با تکنولوژی جدید Houdiniآشنایی با تکنولوژی جدید Houdini
آشنایی با تکنولوژی جدید Houdini
 
Drupalcon 2021 - Nuxt.js for drupal developers
Drupalcon 2021 - Nuxt.js for drupal developersDrupalcon 2021 - Nuxt.js for drupal developers
Drupalcon 2021 - Nuxt.js for drupal developers
 
Introduction to webGL
Introduction to webGLIntroduction to webGL
Introduction to webGL
 
Javascript basics
Javascript basicsJavascript basics
Javascript basics
 
Multiplier Effect: Case Studies in Distributions for Publishers
Multiplier Effect: Case Studies in Distributions for PublishersMultiplier Effect: Case Studies in Distributions for Publishers
Multiplier Effect: Case Studies in Distributions for Publishers
 
Cross-platform JavaScript
Cross-platform JavaScriptCross-platform JavaScript
Cross-platform JavaScript
 
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
 
Front-end development automation with Grunt
Front-end development automation with GruntFront-end development automation with Grunt
Front-end development automation with Grunt
 
Docker Up and Running for Web Developers
Docker Up and Running for Web DevelopersDocker Up and Running for Web Developers
Docker Up and Running for Web Developers
 

Ähnlich wie Gutenberg Extended

Ähnlich wie Gutenberg Extended (20)

Web App Prototypes with Google App Engine
Web App Prototypes with Google App EngineWeb App Prototypes with Google App Engine
Web App Prototypes with Google App Engine
 
Daniel Steigerwald: EsteJS - javascriptové aplikace robusně, modulárně a komf...
Daniel Steigerwald: EsteJS - javascriptové aplikace robusně, modulárně a komf...Daniel Steigerwald: EsteJS - javascriptové aplikace robusně, modulárně a komf...
Daniel Steigerwald: EsteJS - javascriptové aplikace robusně, modulárně a komf...
 
Design Summit - Technology Vision - Oleg Barenboim and Jason Frey
Design Summit - Technology Vision - Oleg Barenboim and Jason FreyDesign Summit - Technology Vision - Oleg Barenboim and Jason Frey
Design Summit - Technology Vision - Oleg Barenboim and Jason Frey
 
JS digest. October 2017
JS digest. October 2017 JS digest. October 2017
JS digest. October 2017
 
Plugin development demystified 2017
Plugin development demystified 2017Plugin development demystified 2017
Plugin development demystified 2017
 
Iteria lowcode 2022-01-10
Iteria lowcode 2022-01-10Iteria lowcode 2022-01-10
Iteria lowcode 2022-01-10
 
Introduction to serverless computing on Google Cloud
Introduction to serverless computing on Google CloudIntroduction to serverless computing on Google Cloud
Introduction to serverless computing on Google Cloud
 
Exploring Google APIs with Python
Exploring Google APIs with PythonExploring Google APIs with Python
Exploring Google APIs with Python
 
Bootstrap4 x pages
Bootstrap4 x pagesBootstrap4 x pages
Bootstrap4 x pages
 
Drools & jBPM Workshop London 2013
Drools & jBPM Workshop London 2013Drools & jBPM Workshop London 2013
Drools & jBPM Workshop London 2013
 
Exploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScriptExploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScript
 
Extending JBoss EPP and Site Publisher your way
Extending JBoss EPP and Site Publisher your wayExtending JBoss EPP and Site Publisher your way
Extending JBoss EPP and Site Publisher your way
 
Faster Drupal sites using Queue API
Faster Drupal sites using Queue APIFaster Drupal sites using Queue API
Faster Drupal sites using Queue API
 
Load testing in Zonky with Gatling
Load testing in Zonky with GatlingLoad testing in Zonky with Gatling
Load testing in Zonky with Gatling
 
Extensible web
Extensible webExtensible web
Extensible web
 
Progressive web applications
Progressive web applicationsProgressive web applications
Progressive web applications
 
Developing word press professionally
Developing word press professionallyDeveloping word press professionally
Developing word press professionally
 
Client vs Server Templating: Speed up initial load for SPA with Angular as an...
Client vs Server Templating: Speed up initial load for SPA with Angular as an...Client vs Server Templating: Speed up initial load for SPA with Angular as an...
Client vs Server Templating: Speed up initial load for SPA with Angular as an...
 
Jbake workshop (Greach 2019)
Jbake workshop (Greach 2019)Jbake workshop (Greach 2019)
Jbake workshop (Greach 2019)
 
Delayed operations with queues for website performance
Delayed operations with queues for website performanceDelayed operations with queues for website performance
Delayed operations with queues for website performance
 

Kürzlich hochgeladen

Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
raffaeleoman
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
Kayode Fayemi
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
Sheetaleventcompany
 

Kürzlich hochgeladen (20)

Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar Training
 
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
 
Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
 
Dreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIIDreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio III
 
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, YardstickSaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
 
Causes of poverty in France presentation.pptx
Causes of poverty in France presentation.pptxCauses of poverty in France presentation.pptx
Causes of poverty in France presentation.pptx
 
lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubs
 
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesVVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
 
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfThe workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
 
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptxMohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
 
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510
 
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
 
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night EnjoyCall Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
 
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
 

Gutenberg Extended

  • 1. Gutenberg Extended How to extend and customize the new WordPress editor
  • 3. Why
  • 4. Why ● Extensibility as core feature ● New possibilities ● New concepts ● Less documentation ● Work in progress ● What do we need?
  • 5. Content ● Blocks ● Theme Support ● Block Templates ● Editor UI ● Data store ● Parser
  • 8. Block API ● Handbook ● GitHub Gutenberg Repository ● CSS-Tricks: Learning Gutenberg ● javascriptforwp.com Course ● create-guten-block Boilerplate ● Tuts+ Tutorial JS: ES5 or ES6/JSX PHP: ServerSideRender
  • 9. ACF Block API The State of ACF in a Gutenberg World
  • 10. Gutenberg Fields Middleware by rtCamp ● Register fields for Gutenberg blocks with a simple, declarative API. ● JS or PHP ● GitHub
  • 11. Gutenberg Cloud ● Reuse across CMSs (WordPress, Drupal, …) ● Discover new blocks ● No plugin bloat, NPM https://gutenbergcloud.org/
  • 12. Extending Blocks wp.hooks ● Hooks like in PHP ● addAction, addFilter, removeAction, removeFilter, doAction, applyFilters ... ● Filter Block API properties and functions ● Handbook examples ● Hooks npm package
  • 15. Theme Support ● Override block styles ● Enable opt-in features (add_theme_support) ● Customize block options ● Apply Styles to editor
  • 16. Theme Support Wide Alignment (Opt-in) ● Classes: ○ .alignfull ○ .alignwide
  • 17. Theme Support Editor Color Palette (Customize) ● Classes: ○ has-slug-background-color // background ○ has-slug-color // Text ● disable-custom-colors // Color picker
  • 18. Theme Support Editor font Sizes (Customize) ● Class: has-slug-font-size
  • 19. Theme Support Editor Styles ● Editor Styles: Auto-prefix: .editor-block-list__block ● Support dark background themes ● Add default Styles ● Alternative: Extra stylesheet via enqueue_block_editor_assets hook
  • 21. Templates ● list of block items ● initial state for an editor session ● attributes and placeholder content ● per custom post type ● PHP and JS API ● Many planned additions Handbook Video Tutorial
  • 23. Editor UI ● Plugins API ● Slot / Fill ● Sidebar, Toolbar, Pre-publish panel, own Sidebar, ...
  • 24. Editor UI ● Own Sidebar ● Examples ○ Yoast ○ Drop it ○ Public Post Preview
  • 26. Data store ● modular pattern for organizing and sharing data ● Redux like core principles ● Browser plugins ● Handbook ● Beyond the block - David Remer (inpsyde.com) (+Video + Code) ● Redux with WordPress - Josh Pollock ● Efficient client data management for WordPress Plugins - Riad Benguella
  • 27. Data store ● core/data, core/nux, core/viewport, core/editor, core/edit-post, yoast- seo/editor, … ● registerStore('my-shop', {...}) ● store.select(): Returns the state value of the registered reducer ● store.subscribe( listener: Function ): Registers a function called any time the value of state changes. ● store.dispatch( action: Object ): Given an action object, calls the registered reducer and updates the state value.
  • 28. Data store ● get current post content ● get currently selected tags/categories ● is Sidebar visible ● notify if an image block is inserted ● Rest API data (latest post, user object, create category) ● Store / upsate own plugin data ● get Data from other plugins ● extend other plugins
  • 30. Parser ● HTML structure to data structure ● Server-side parser ● Client-side parser (not replaceable yet) ● Handbook ● Compare parser ● An experimental Rust parser (100 - 1000 times faser)
  • 31. We need you! Documentation Code examples Blog posts Tutorials ...
  • 32. This is the end! Sören Wrede @soean

Hinweis der Redaktion

  1. const { registerBlockType } = wp.blocks; const blockStyle = { backgroundColor: '#900', color: '#fff'}; registerBlockType( 'extendeing-blocks/wc-wue', { title: 'Hello World', icon: 'universal-access-alt', description: 'This is just a simple block', category: 'layout', keywords: [ 'wordcamp', 'barcamp', 'wordpress' ], supports: { html: false, } edit() { return <p style={ blockStyle }>Hello editor.</p>; }, save() { return <p style={ blockStyle }>Hello saved content.</p>; }, } );
  2. const { registerBlockType } = wp.blocks; const blockStyle = { backgroundColor: '#900', color: '#fff', padding: '20px' }; registerBlockType( 'extendeing-blocks/wc-wue', { title: 'Hello World', icon: 'universal-access-alt', description: 'This is just a simple block', category: 'layout', keywords: [ 'wordcamp', 'barcamp', 'wordpress' ], supports: { html: false, } edit() { return <p style={ blockStyle }>Hello editor.</p>; }, save() { return <p style={ blockStyle }>Hello saved content.</p>; }, } );
  3. const { registerBlockType } = wp.blocks; const blockStyle = { backgroundColor: '#900', color: '#fff', padding: '20px' }; registerBlockType( 'extendeing-blocks/wc-wue', { title: 'Hello World', icon: 'universal-access-alt', description: 'This is just a simple block', category: 'layout', keywords: [ 'wordcamp', 'barcamp', 'wordpress' ], supports: { html: false, } edit() { return <p style={ blockStyle }>Hello editor.</p>; }, save() { return <p style={ blockStyle }>Hello saved content.</p>; }, } );