Sviluppo dei blocchi di Gutenberg per programmatori senza tempo

Mauricio Gelves
Mauricio GelvesDesarrollador freelance de WordPress, WooCommerce y Frontend at maugelves.com
Sviluppo dei blocchi di Gutenberg per
programmatori senza tempo
M A U R I C I O G E L V E S - @ m a u g e l v e s
Sviluppatore Freelance WP
Nomade Digitale
SiteGround Brand Ambassador
Ciao!
Sono Mauricio Gelves
🎬 youtube.com/c/mauriciogelves
📸 instagram.com/maugelves
🌎 maugelves.com
Come faccio per creare un blocco di Gutenberg con ACF?
Mani al codice
Sviluppo dei blocchi di Gutenberg per programmatori senza tempo
Esportare i campi a JSON e PHP
Registrare il blocco di Gutenberg
Creare campi personalizzati con ACF
Creare il mockup (HTML/CSS) per renderizzare il blocco
Aggiungere i stili del tema nel backend
Quale sono i passi?
<?php
/**
* Creates Talk Gutenberg Block.
*/
function wcz_create_talk_gb_block() {
// register a testimonial block
acf_register_block( [
'name' => 'talk',
'title' => __( 'Talk', $DOMAIN_NAME ),
'description' => __('Block with basic info of the talk.', $DOMAIN_NAME),
'render_callback' => 'talk_block_render_callback',
'category' => ‘wctorino',
'mode' => ‘auto',
'icon' => 'image-filter',
'keywords' => [ 'talk', 'quote' ],
] );
}
add_action('acf/init', 'wcz_create_talk_gb_block');
Creare campi personalizzati con ACF
Registrare il blocco di Gutenberg
Quale sono i passi?
Esportare i campi a JSON e PHP
Creare il mockup (HTML/CSS) per renderizzare il blocco
Aggiungere i stili del tema nel backend
Campi Personalizzati con ACF
Sviluppo dei blocchi di Gutenberg per programmatori senza tempo
Creare campi personalizzati con ACF
Registrare il blocco di Gutenberg
Quale sono i passi?
Esportare i campi a JSON e PHP
Creare il mockup (HTML/CSS) per renderizzare il blocco
Aggiungere i stili del tema nel backend
Creare campi personalizzati con ACF
Registrare il blocco di Gutenberg
Quale sono i passi?
Esportare i campi a JSON e PHP
Creare il mockup (HTML/CSS) per renderizzare il blocco
Aggiungere i stili del tema nel backend
<?php
// Title.
?>
<div class="talk__meta">
<h3 class="talk__h"><?php the_field( 'wtr_gb_talk_title' ); ?></h3>
<p class="talk__b"><?php the_field( ‘wtr_gb_talk_description' ); ?></p>
</div><!-- END .talk__meta -->
Creare campi personalizzati con ACF
Registrare il blocco di Gutenberg
Quale sono i passi?
Esportare i campi a JSON e PHP
Creare il mockup (HTML/CSS) per renderizzare il blocco
Aggiungere i stili del tema nel backend
<?php
/*
* Enqueue the stylesheets for Gutenberg.
*/
function wtr_admin_styles() {
// Register the styles.
wp_register_style('style', get_bloginfo('template_url') . '/style.css', array(),false);
// Enqueue the styles.
wp_enqueue_style('style');
}
add_action( 'enqueue_block_editor_assets', ‘wtr_admin_styles' );
Sviluppo dei blocchi di Gutenberg per programmatori senza tempo
Ora lo faremos passo a passo.
WORKSHOP
goo.gl/XKj95b
Scarica e importa questo file
La WordCamp ci chiede…
Creare un nuovo blocco per aggiungere gli assistenti dell'evento
nella Homepage del sito web.
Includere campi per il nome, foto e il account di Twitter.
Mostrare (come volete) gli assistenti nel Frontend del sito web.
🚨 goo.gl/KYU5Cr
Code Snippets
📂 goo.gl/yigK2u
Scarica il File da qui
WP Backend
User: admin
Password: admin
Grazie
YouTube | Instagram | maugelves.com
Mi potete trovare in tutti posti come @maugelves
1 of 19

Recommended

PrestaShop 1.7 by
PrestaShop 1.7PrestaShop 1.7
PrestaShop 1.7Bwlab
305 views15 slides
StarterTheme Prestashop 1.7 by
StarterTheme Prestashop 1.7StarterTheme Prestashop 1.7
StarterTheme Prestashop 1.7Bwlab
768 views25 slides
Matteo Bicocchi - Introducing HTML5 by
Matteo Bicocchi - Introducing HTML5Matteo Bicocchi - Introducing HTML5
Matteo Bicocchi - Introducing HTML5Pietro Polsinelli
582 views51 slides
Html5 e css3 nuovi strumenti per un nuovo web by
Html5 e css3 nuovi strumenti per un nuovo webHtml5 e css3 nuovi strumenti per un nuovo web
Html5 e css3 nuovi strumenti per un nuovo webMassimo Bonanni
1.7K views64 slides
Corso WebApp iOS - Lezione 06: Web Development for iOS Devices by
Corso WebApp iOS - Lezione 06:   Web Development for iOS DevicesCorso WebApp iOS - Lezione 06:   Web Development for iOS Devices
Corso WebApp iOS - Lezione 06: Web Development for iOS DevicesAndrea Picchi
418 views85 slides
Wcmil2018 by
Wcmil2018Wcmil2018
Wcmil2018ErikaGili
179 views32 slides

More Related Content

Similar to Sviluppo dei blocchi di Gutenberg per programmatori senza tempo

Hands on MVC - Mastering the Web by
Hands on MVC - Mastering the WebHands on MVC - Mastering the Web
Hands on MVC - Mastering the WebClaudio Gandelli
1.4K views94 slides
Sviluppare Plugin per WordPress by
Sviluppare Plugin per WordPress Sviluppare Plugin per WordPress
Sviluppare Plugin per WordPress Thomas Vitale
2.4K views51 slides
Dojo nuovo look alle vostre applicazioni web Domino by
Dojo nuovo look alle vostre applicazioni web DominoDojo nuovo look alle vostre applicazioni web Domino
Dojo nuovo look alle vostre applicazioni web DominoDominopoint - Italian Lotus User Group
952 views43 slides
HTML e CSS by
HTML e CSSHTML e CSS
HTML e CSSManuel Scapolan
1.9K views44 slides
L'Arte del Templating: Typoscript, Fluid e Grid Elements by
L'Arte del Templating: Typoscript, Fluid e Grid ElementsL'Arte del Templating: Typoscript, Fluid e Grid Elements
L'Arte del Templating: Typoscript, Fluid e Grid ElementsElena Bartolotti
1.4K views51 slides
Ancora anatomia, le pagine HTML(5) by
Ancora anatomia, le pagine HTML(5)Ancora anatomia, le pagine HTML(5)
Ancora anatomia, le pagine HTML(5)nois3lab
707 views26 slides

Similar to Sviluppo dei blocchi di Gutenberg per programmatori senza tempo(20)

Sviluppare Plugin per WordPress by Thomas Vitale
Sviluppare Plugin per WordPress Sviluppare Plugin per WordPress
Sviluppare Plugin per WordPress
Thomas Vitale2.4K views
L'Arte del Templating: Typoscript, Fluid e Grid Elements by Elena Bartolotti
L'Arte del Templating: Typoscript, Fluid e Grid ElementsL'Arte del Templating: Typoscript, Fluid e Grid Elements
L'Arte del Templating: Typoscript, Fluid e Grid Elements
Elena Bartolotti1.4K views
Ancora anatomia, le pagine HTML(5) by nois3lab
Ancora anatomia, le pagine HTML(5)Ancora anatomia, le pagine HTML(5)
Ancora anatomia, le pagine HTML(5)
nois3lab707 views
Convegno gt 2006: Presentazione e Wordpress by convegnogt
Convegno gt 2006: Presentazione e WordpressConvegno gt 2006: Presentazione e Wordpress
Convegno gt 2006: Presentazione e Wordpress
convegnogt318 views
Sencha touch: panoramica e orientamento sul codice by Giuseppe Toto
Sencha touch: panoramica e orientamento sul codiceSencha touch: panoramica e orientamento sul codice
Sencha touch: panoramica e orientamento sul codice
Giuseppe Toto2.2K views
Corso Pratico di WordPress by Nicola Strumia
Corso Pratico di WordPressCorso Pratico di WordPress
Corso Pratico di WordPress
Nicola Strumia7.4K views
Luca Masini: Introduzione a GWT 2.0 by firenze-gtug
Luca Masini: Introduzione a GWT 2.0Luca Masini: Introduzione a GWT 2.0
Luca Masini: Introduzione a GWT 2.0
firenze-gtug999 views
Giovambattista Fazioli, 10 more things by KnowCamp
Giovambattista Fazioli, 10 more thingsGiovambattista Fazioli, 10 more things
Giovambattista Fazioli, 10 more things
KnowCamp501 views

More from Mauricio Gelves

Introducción a GitFlow by
Introducción a GitFlowIntroducción a GitFlow
Introducción a GitFlowMauricio Gelves
372 views43 slides
Segui questi 10 passi per diventare Freelance con WordPress by
Segui questi 10 passi per diventare Freelance con WordPressSegui questi 10 passi per diventare Freelance con WordPress
Segui questi 10 passi per diventare Freelance con WordPressMauricio Gelves
230 views26 slides
Simple tricks to improve the performance of your site by
Simple tricks to improve the performance of your siteSimple tricks to improve the performance of your site
Simple tricks to improve the performance of your siteMauricio Gelves
321 views22 slides
Gutenberg Blocks Development for Programmers with no time by
Gutenberg Blocks Development for Programmers with no timeGutenberg Blocks Development for Programmers with no time
Gutenberg Blocks Development for Programmers with no timeMauricio Gelves
196 views12 slides
WordPress: el mejor amigo para tu emprendimiento by
WordPress: el mejor amigo para tu emprendimientoWordPress: el mejor amigo para tu emprendimiento
WordPress: el mejor amigo para tu emprendimientoMauricio Gelves
1K views37 slides
Gutenberg Blocks Development for Programmers with NO time by
Gutenberg Blocks Development for Programmers with NO timeGutenberg Blocks Development for Programmers with NO time
Gutenberg Blocks Development for Programmers with NO timeMauricio Gelves
290 views19 slides

More from Mauricio Gelves(20)

Segui questi 10 passi per diventare Freelance con WordPress by Mauricio Gelves
Segui questi 10 passi per diventare Freelance con WordPressSegui questi 10 passi per diventare Freelance con WordPress
Segui questi 10 passi per diventare Freelance con WordPress
Mauricio Gelves230 views
Simple tricks to improve the performance of your site by Mauricio Gelves
Simple tricks to improve the performance of your siteSimple tricks to improve the performance of your site
Simple tricks to improve the performance of your site
Mauricio Gelves321 views
Gutenberg Blocks Development for Programmers with no time by Mauricio Gelves
Gutenberg Blocks Development for Programmers with no timeGutenberg Blocks Development for Programmers with no time
Gutenberg Blocks Development for Programmers with no time
Mauricio Gelves196 views
WordPress: el mejor amigo para tu emprendimiento by Mauricio Gelves
WordPress: el mejor amigo para tu emprendimientoWordPress: el mejor amigo para tu emprendimiento
WordPress: el mejor amigo para tu emprendimiento
Mauricio Gelves1K views
Gutenberg Blocks Development for Programmers with NO time by Mauricio Gelves
Gutenberg Blocks Development for Programmers with NO timeGutenberg Blocks Development for Programmers with NO time
Gutenberg Blocks Development for Programmers with NO time
Mauricio Gelves290 views
Flexbox y Grid: Los mejores amigos del maquetador by Mauricio Gelves
Flexbox y Grid: Los mejores amigos del maquetadorFlexbox y Grid: Los mejores amigos del maquetador
Flexbox y Grid: Los mejores amigos del maquetador
Mauricio Gelves668 views
Desarrollo de bloques de Gutenberg para programadores con poco tiempo by Mauricio Gelves
Desarrollo de bloques de Gutenberg para programadores con poco tiempoDesarrollo de bloques de Gutenberg para programadores con poco tiempo
Desarrollo de bloques de Gutenberg para programadores con poco tiempo
Mauricio Gelves458 views
Follow these 10 steps to become a freelancer with WordPress by Mauricio Gelves
Follow these 10 steps to become a freelancer with WordPressFollow these 10 steps to become a freelancer with WordPress
Follow these 10 steps to become a freelancer with WordPress
Mauricio Gelves1.7K views
Domina el CSS de tu Web con la ténica BEM (bonito, elegante y molón) by Mauricio Gelves
Domina el CSS de tu Web con la ténica BEM (bonito, elegante y molón) Domina el CSS de tu Web con la ténica BEM (bonito, elegante y molón)
Domina el CSS de tu Web con la ténica BEM (bonito, elegante y molón)
Mauricio Gelves281 views
10 pasos para convertirte en Freelance con WordPress by Mauricio Gelves
10 pasos para convertirte en Freelance con WordPress10 pasos para convertirte en Freelance con WordPress
10 pasos para convertirte en Freelance con WordPress
Mauricio Gelves655 views
Gutenberg: Pros and Cons for this big change in WordPress by Mauricio Gelves
Gutenberg: Pros and Cons for this big change in WordPressGutenberg: Pros and Cons for this big change in WordPress
Gutenberg: Pros and Cons for this big change in WordPress
Mauricio Gelves322 views
Il database di WordPress: Dodici tabelle che servono per fare di tutto e di più. by Mauricio Gelves
Il database di WordPress: Dodici tabelle che servono per fare di tutto e di più.Il database di WordPress: Dodici tabelle che servono per fare di tutto e di più.
Il database di WordPress: Dodici tabelle che servono per fare di tutto e di più.
Mauricio Gelves328 views
Vive de vacaciones con WordPress by Mauricio Gelves
Vive de vacaciones con WordPressVive de vacaciones con WordPress
Vive de vacaciones con WordPress
Mauricio Gelves111 views
Quiero aprender WordPress ¿Por donde empiezo? by Mauricio Gelves
Quiero aprender WordPress ¿Por donde empiezo?Quiero aprender WordPress ¿Por donde empiezo?
Quiero aprender WordPress ¿Por donde empiezo?
Mauricio Gelves335 views
Vive de tus sueños con WordPress by Mauricio Gelves
Vive de tus sueños con WordPressVive de tus sueños con WordPress
Vive de tus sueños con WordPress
Mauricio Gelves299 views
Taller de Iniciación a WordPress by Mauricio Gelves
Taller de Iniciación a WordPressTaller de Iniciación a WordPress
Taller de Iniciación a WordPress
Mauricio Gelves283 views
WordPress Database: What's behind those 12 tables by Mauricio Gelves
WordPress Database: What's behind those 12 tablesWordPress Database: What's behind those 12 tables
WordPress Database: What's behind those 12 tables
Mauricio Gelves726 views
La base de datos de WordPress by Mauricio Gelves
La base de datos de WordPressLa base de datos de WordPress
La base de datos de WordPress
Mauricio Gelves2.3K views

Sviluppo dei blocchi di Gutenberg per programmatori senza tempo

  • 1. Sviluppo dei blocchi di Gutenberg per programmatori senza tempo M A U R I C I O G E L V E S - @ m a u g e l v e s
  • 2. Sviluppatore Freelance WP Nomade Digitale SiteGround Brand Ambassador Ciao! Sono Mauricio Gelves 🎬 youtube.com/c/mauriciogelves 📸 instagram.com/maugelves 🌎 maugelves.com
  • 3. Come faccio per creare un blocco di Gutenberg con ACF? Mani al codice
  • 5. Esportare i campi a JSON e PHP Registrare il blocco di Gutenberg Creare campi personalizzati con ACF Creare il mockup (HTML/CSS) per renderizzare il blocco Aggiungere i stili del tema nel backend Quale sono i passi?
  • 6. <?php /** * Creates Talk Gutenberg Block. */ function wcz_create_talk_gb_block() { // register a testimonial block acf_register_block( [ 'name' => 'talk', 'title' => __( 'Talk', $DOMAIN_NAME ), 'description' => __('Block with basic info of the talk.', $DOMAIN_NAME), 'render_callback' => 'talk_block_render_callback', 'category' => ‘wctorino', 'mode' => ‘auto', 'icon' => 'image-filter', 'keywords' => [ 'talk', 'quote' ], ] ); } add_action('acf/init', 'wcz_create_talk_gb_block');
  • 7. Creare campi personalizzati con ACF Registrare il blocco di Gutenberg Quale sono i passi? Esportare i campi a JSON e PHP Creare il mockup (HTML/CSS) per renderizzare il blocco Aggiungere i stili del tema nel backend
  • 10. Creare campi personalizzati con ACF Registrare il blocco di Gutenberg Quale sono i passi? Esportare i campi a JSON e PHP Creare il mockup (HTML/CSS) per renderizzare il blocco Aggiungere i stili del tema nel backend
  • 11. Creare campi personalizzati con ACF Registrare il blocco di Gutenberg Quale sono i passi? Esportare i campi a JSON e PHP Creare il mockup (HTML/CSS) per renderizzare il blocco Aggiungere i stili del tema nel backend
  • 12. <?php // Title. ?> <div class="talk__meta"> <h3 class="talk__h"><?php the_field( 'wtr_gb_talk_title' ); ?></h3> <p class="talk__b"><?php the_field( ‘wtr_gb_talk_description' ); ?></p> </div><!-- END .talk__meta -->
  • 13. Creare campi personalizzati con ACF Registrare il blocco di Gutenberg Quale sono i passi? Esportare i campi a JSON e PHP Creare il mockup (HTML/CSS) per renderizzare il blocco Aggiungere i stili del tema nel backend
  • 14. <?php /* * Enqueue the stylesheets for Gutenberg. */ function wtr_admin_styles() { // Register the styles. wp_register_style('style', get_bloginfo('template_url') . '/style.css', array(),false); // Enqueue the styles. wp_enqueue_style('style'); } add_action( 'enqueue_block_editor_assets', ‘wtr_admin_styles' );
  • 16. Ora lo faremos passo a passo. WORKSHOP
  • 18. La WordCamp ci chiede… Creare un nuovo blocco per aggiungere gli assistenti dell'evento nella Homepage del sito web. Includere campi per il nome, foto e il account di Twitter. Mostrare (come volete) gli assistenti nel Frontend del sito web. 🚨 goo.gl/KYU5Cr Code Snippets 📂 goo.gl/yigK2u Scarica il File da qui WP Backend User: admin Password: admin
  • 19. Grazie YouTube | Instagram | maugelves.com Mi potete trovare in tutti posti come @maugelves