Skip to content

ovidijusr/gutenfactory

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GutenFactory

Description

Since Gutenberg itself is JavaScript/React based, you also need to know JavaScript/React to create custom blocks. Or, you needed to know. GutenFactory, as the name suggests, aims to bring techniques of mass production into the new world of Gutenberg,

Once this plugin is activated, all you need to do is to pass some configuration options via PHP and add a pinch of CSS to make things look nice. Like this:

add_filter( 'gutenfactory_blocks', 'my_awesome_block' );
function my_awesome_block( $blocks ) {
  $blocks['arunas/my_awesome_block'] = [
    'name'          => 'My Awesome Block',
    'category'      => 'common',
    'style'         => plugins_url( 'my-awesome-block.css', __FILE__ ),
    'editor_style'  => plugins_url( 'my-awesome-block-editor.css', __FILE__ ),
    'callback'      => 'my_awesome_block_render',
    'fields'        => [
     // define the fields here.
    ]
  ];
}

GutenFactory will take this information, some standard Gutenberg components like TextControl and RichText and some custom JS to build a custom Gutenberg block for you, automatically.

In the plugin directory, you can find another plugin, my-cool-plugin, which illustrates how to create a simple Hero Image block using GutenFactory.

GutenFactory has been started on the Contributors day of WordCamp Norrköping 2018 by Arūnas Liuiza and Stanislav Khromov.

Note: This is still a very early work in progress, a lot features are still not implemented or can change in development. Do not use it on any kind of production environment.

Installation

  1. Upload gutenfactory directory to the /wp-content/plugins/ directory
  2. Activate the plugin through the 'Plugins' menu in WordPress
  3. Use the gutenfactory_blocks filter to declare new blocks in your plugins/themes

Frequently Asked Questions

Changelog

  • 0.1 - Initial release

Upgrade Notice

No upgrade notices

Screenshots

No screenshots yet

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 71.5%
  • JavaScript 25.7%
  • CSS 2.8%