https://github.com/palmiak/timber-acf-wp-blocks
Create Gutenberg blocks from Twig templates and ACF fields.
https://github.com/palmiak/timber-acf-wp-blocks
hacktoberfest twig-templates
Last synced: about 1 year ago
JSON representation
Create Gutenberg blocks from Twig templates and ACF fields.
- Host: GitHub
- URL: https://github.com/palmiak/timber-acf-wp-blocks
- Owner: palmiak
- License: mit
- Created: 2019-06-01T13:50:17.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-05-17T19:26:57.000Z (about 2 years ago)
- Last Synced: 2025-04-04T00:11:28.889Z (over 1 year ago)
- Topics: hacktoberfest, twig-templates
- Language: PHP
- Homepage: https://palmiak.github.io/timber-acf-wp-blocks/
- Size: 107 KB
- Stars: 246
- Watchers: 14
- Forks: 28
- Open Issues: 28
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Timber ACF WP Blocks
Generate ACF Gutenberg blocks just by adding templates to your Timber theme. This package is based heavily on [this article](https://medium.com/nicooprat/acf-blocks-avec-gutenberg-et-sage-d8c20dab6270) by [nicoprat](https://github.com/nicooprat) and the [plugin](https://github.com/MWDelaney/sage-acf-wp-blocks) by [MWDelaney](https://github.com/MWDelaney).
## Complete documentation
[Read the complete documentation](https://palmiak.github.io/timber-acf-wp-blocks/#/)
## Contributors
This plugin is build with help of contributors:
- [roylodder](https://github.com/roylodder)
- [BrentWMiller](https://github.com/BrentWMiller)
- [Marcin Krzemiński](https://github.com/marcinkrzeminski)
- [Kuba Mikita](https://github.com/Kubitomakita)
- [LandWire](https://github.com/landwire)
- [Viktor Szépe](https://github.com/szepeviktor)
## Creating blocks
Add twig templates to `views/blocks` which get and use ACF data. Each template requires a comment block with some data in it:
```twig
{#
Title: Testimonial
Description: Customer testimonial
Category: formatting
Icon: admin-comments
Keywords: testimonial quote "customer testimonial"
Mode: edit
Align: left
PostTypes: page post
SupportsAlign: left right
SupportsMode: false
SupportsMultiple: false
#}
{{ fields.testimonial }}
{{ fields.author }}
[data-{{ block.id }}] {
background: {{ fields.background_color }};
color: {{ fields.text_color }};
}
```
## Timber 2.0
**Timber ACF WP Blocks** is fully compatible with both **Timber 1.x** and **Timber 2.x** versions.