Git Product home page Git Product logo

block-lab's Introduction

Block Lab

Contributors: lukecarbis, ryankienstra, Stino11, rheinardkorf Tags: gutenberg, blocks, block editor, fields, template Requires at least: 5.0 Tested up to: 5.5 Requires PHP: 5.6 Stable tag: trunk License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl

The easy way to build custom blocks for Gutenberg.

Description

IMPORTANT!

The Block Lab team has moved to Genesis Custom Blocks. To take advantage of all the great things about Block Lab as well as gain access to all new features as they are released, we recommend that you install Genesis Custom Blocks.

If youโ€™re an existing Block Lab user and would like to learn more about what this means for you, including how to easily and automatically migrate to the new plugin, you can find more details here.


Features

A Familiar Experience

Work within the WordPress admin with an interface you already know.

Block Fields

Add from a growing list of available fields to your custom blocks.

Simple Templating

Let the plugin do the heavy lifting so you can use familiar WordPress development practices to build block templates.

Developer Friendly Functions

Simple to use functions, ready to render and work with the values stored through your custom block fields.

Links

Installation

From Within WordPress

  • Visit Plugins > Add New
  • Search for "Block Lab"
  • Install the Block Lab plugin
  • Activate Block Lab from your Plugins page.

Manually

  • Clone Block Lab into a working directory with https://github.com/getblocklab/block-lab.git
  • cd into the block-lab directory, and run npm install && composer install
  • Next, build the scripts and styles with npm build
  • Move the block-lab folder to your /wp-content/plugins/ directory
  • Activate the Block Lab plugin through the Plugins menu in WordPress

Frequently Asked Questions

Q: Do I need to write code to use this plugin? A: Although the plugin handles the majority of the work in building a custom block, you will need to build HTML templates to display the content of the block. You can learn how in the developer documentation.

Q: I have an idea for the plugin A: This plugin is open source and can only be better through community contribution. The GitHub repo is here.

Q: Where can I find documentation for this plugin? A: Here

Contributing

See Contributing to Genesis Custom Blocks.

block-lab's People

Contributors

byronkeet avatar dependabot-preview[bot] avatar jasperspeicher avatar jeffpaul avatar kienstra avatar kopepasah avatar lukecarbis avatar mukeshpanchal27 avatar pedro-mendonca avatar pharmarin avatar phpbits avatar rheinardkorf avatar robstino avatar rohan2388 avatar ronaldhuereca avatar shwethakpradeep avatar violy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

block-lab's Issues

Can't use Number in Block Slug

I noticed that although I could successfully save a custom block with a number character in the slug, as well as set up the template file, the block was not accessible in the GB editor. After changing the slug (removing number), and updating the template to match I was able to access it in the editor.

Export block as stand-alone plugin.

It would be nice if there was a way to export a block as a standalone plugin with minimal scaffolding required.

It would still need to maintain the current acb_locate_template() mechanism and template loader.

Error when publishing a CPT

When tryinh to publish a CPT from another plugin, I get the WordPress admin error
The link you have followed has expired
When I disable this plugin, I am able to publish as normal.
Have tested on a few environments and observed the same issue.

"Select" control type

This should introduce the concept of control options for custom fields. Potentially, abstract fields out further to have a field type interface / abstract, with each field type (text, texture, select) implemented as its own class.

  • Choices

"Post" control type

A searchable list of posts, from a given post type.

  • Post type
  • Post
  • Taxonomy filter

Add Block Icon to Properties panel

The user should be able to choose from the Dashicons library. The options should be displayed visually, not as text from a dropdown menu.

Only dashicons for now.

Block preview

In the editor, once the fields have been completed, a preview of the block is show.

This should include the ability to return to "edit" mode to change the fields again.

PHP Notices when fields not provided.

Steps:

  • Create new custom block.
  • Provide title, description, slug.
  • DON'T add any fields.
  • Publish the block.

Result:

Notice: Undefined index: fields 

Need to check for empty value.

Improve plugin packaging scripts.

The current scripts are incredibly basic and has been used as a quick way to clean up the plugin for distribution.

We need to consider whether gulp is the right tool for the job, what we ideally would like automated (e.g. readme.txt with auto changelog), etc.

Textarea/Text max length defaults to zero.

When not providing a value to the max length property it defaults to zero and you can't enter characters. This value needs to not be written to the json value, or use the HTML default of 524288.

Fatal Error on Plugin Activation

Plugin could not be activated because it triggered a fatal error.

Fatal error: Uncaught Error: Class 'AdvancedCustomBlocks\View\Admin_Menu' not found in /var/www/vhosts/acb.number11.co/httpdocs/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php:95 Stack trace: #0 /var/www/vhosts/acb.number11.co/httpdocs/wp-admin/includes/plugin.php(1897): include() #1 /var/www/vhosts/acb.number11.co/httpdocs/wp-admin/plugins.php(178): plugin_sandbox_scrape('advanced-custom...') #2 {main} thrown in /var/www/vhosts/acb.number11.co/httpdocs/wp-content/plugins/advanced-custom-blocks/advanced-custom-blocks.php on line 95

  • This is on a new WP install.
  • Plugin is v0.1 from the wp.org repo
  • Default theme
  • Not other plugins active
  • PHP 7.1.20
  • Has Let's Encrypt SSL Cert
  • https://acb.number11.co/
  • Apache

Frontend API

acb_field( $name, $echo ) and acb_value( $name ).

Lost our Dashicon Icons

With the update to the icons in GB (Material icons), it seems we've lost access, in the current format, to dashicons.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.