Generate ACF Gutenberg blocks just by adding templates to your Timber theme. This package is based heavily on this article by nicoprat and the plugin by MWDelaney.
Automatic block.json generation, modern block registration, and full compatibility with ACF PRO 6.6+. Fully backwards compatible with existing flat file structures.
- Read the documentation to learn everything this package can do.
This repository is an independently maintained fork with additional fixes and features that are not present in the original upstream package.
The current Composer package name is still palmiak/timber-acf-wp-blocks, so you must add this fork as a VCS repository before requiring it:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/kevin-terry/timber-acf-wp-blocks"
}
],
"require": {
"palmiak/timber-acf-wp-blocks": "dev-master"
}
}Or install it with Composer after adding the vcs repository entry:
composer require palmiak/timber-acf-wp-blocks:dev-masterWarning: if you do not add the VCS repository entry for
https://github.com/kevin-terry/timber-acf-wp-blocks, Composer may resolve the original upstream package instead of this fork.
This plugin is built with help of contributors:
- Kevin Terry — block.json generation, API v3 support
- roylodder
- BrentWMiller
- Marcin Krzemiński
- Kuba Mikita
- LandWire
- Viktor Szépe
Create a subfolder in views/blocks with a matching Twig template. The plugin auto-generates block.json from your template headers:
views/blocks/testimonial/
├── testimonial.twig
├── block.json (auto-generated)
└── example.png (optional preview image){#
Title: Testimonial
Description: Customer testimonial
Category: formatting
Icon: admin-comments
Keywords: testimonial quote
Mode: preview
SupportsAlign: left right
#}
<blockquote data-{{ block.id }}>
<p>{{ fields.testimonial }}</p>
<cite>
<span>{{ fields.author }}</span>
</cite>
</blockquote>
<style type="text/css">
[data-{{ block.id }}] {
background: {{ fields.background_color }};
color: {{ fields.text_color }};
}
</style>Timber ACF WP Blocks is fully compatible with both Timber 1.x and Timber 2.x versions.
You can report security bugs through the Patchstack Vulnerability Disclosure Program. The Patchstack team helps validate, triage, and handle any security vulnerabilities. Report a security vulnerability.
