Download the PHP package lachlanarthur/sage8-acf-wp-blocks without Composer
On this page you can find all versions of the php package lachlanarthur/sage8-acf-wp-blocks. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lachlanarthur/sage8-acf-wp-blocks
More information about lachlanarthur/sage8-acf-wp-blocks
Files in lachlanarthur/sage8-acf-wp-blocks
Package sage8-acf-wp-blocks
Short Description Create Gutenberg blocks from Sage 8 templates and ACF fields.
License MIT
Homepage https://github.com/LachlanArthur/sage8-acf-wp-blocks
Informations about the package sage8-acf-wp-blocks
Sage 8 ACF Gutenberg Blocks
Generate ACF Gutenberg blocks just by adding templates to your Sage 8 theme. This package is forked from the Sage 9 version by MWDelaney which is based heavily on this article by nicoprat.
Installation
Run the following in your Sage 8-based theme directory:
Requirements
- Wordpress 5+
- Advanced Custom Fields 5.8+
- Theme based on Sage 8 (See the original for Sage 9)
Creating blocks
Add templates to your-theme/wp-blocks
which get and use ACF data. Each template requires a metadata comment block with some data in it:
Example block template
Block options
Option | Value |
---|---|
Category | common formatting layout widgets embed Create your own |
Icon | The name of a Dashicon |
Post Types | Space-delimited list of post types |
Default Mode | preview edit |
Default Alignment | left center right wide full |
Creating ACF fields
Once a block is created you'll be able to assign ACF fields to it using the standard Custom Fields interface in WordPress. We recommend using sage-advanced-custom-fields to keep your ACF fields in version control with Sage.
Changing the blocks directory
The wp-blocks
directory can be changed with the filter sage8-acf-wp-blocks-paths
: