Download the PHP package beblife/acf-gutenberg-blocks without Composer

On this page you can find all versions of the php package beblife/acf-gutenberg-blocks. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package acf-gutenberg-blocks

ACF Gutenberg blocks

An elegant way for developers to register Gutenberg blocks using the Advanced Custom Fields PRO features.

Installation

You can install this package through composer:

Define blocks

You can define custom blocks by creating classes that extend the base block class provided by this package.

By extending from the base block enables you to easily define custom blocks with a minimum of configuration:

The base block class configures a few things by default behind the scence for convenience but can be changed easily. The following properties are defined out of the box:

Register blocks

To enable the custom blocks you need to register them by hooking into the acf/init filter. This allows for a flexible way to define which blocks should be enabled.

You can enable blocks by passing an array with classes:

To automatically register all blocks in a directory can provide the relative path in the current theme:

Defining a parent block

You can define a block to have a parent block by updating the $parent property on your block class. This will result in the block being hidden from the blocks list in Gutenberg but only available as a "sub block" for the parent block.

For the child block to be selectable within the parent block you will need to set $inner_blocks = true on the parent block.

Configure fields

Fields can be added to a custom block by defining a fields() method on the class and make it return an array of fields to add.

This package includes wordplate/extended-acf to define fields for a block in an easy and elegant way. Make sure to read the documentation to see which field types are available.

Below you can find an example of how you can define fields using this package:

Retrieve data

To retrieve the data from the defined fields you have a few options.

Define classes

By default a few classes are added to the wrapper HTML-element to be able to add general styles and specific styles for blocks and respect the alignment and other input from the Gutenberg editor.

You can override or extend the classes that are added by defining your own classes method:

Please note that when overriding the default classes some Gutenberg behaviour will no longer work and will have to be added from the $block parameter to prevent this from happening!

Render blocks

All blocks require a render() method to be implemented. The way you render a block is up to you, an example with Wordpress' get_template_part() is given below:

License

Laurens Bultynck


All versions of acf-gutenberg-blocks with dependencies

PHP Build Version
Package Version
Requires php Version >7.0
wordplate/acf Version ^8.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package beblife/acf-gutenberg-blocks contains the following files

Loading the files please wait ....