Coder Social home page Coder Social logo

engcode / timber-acf-wp-blocks Goto Github PK

View Code? Open in Web Editor NEW

This project forked from palmiak/timber-acf-wp-blocks

0.0 1.0 0.0 101 KB

Create Gutenberg blocks from Twig templates and ACF fields.

Home Page: https://palmiak.github.io/timber-acf-wp-blocks/

License: MIT License

PHP 100.00%

timber-acf-wp-blocks's Introduction

Timber ACF WP Blocks

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.

Complete documentation

Read the complete documentation

Contributors

This plugin is build with help of contributors:

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:

{#
  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
#}

<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 2.0

Timber ACF WP Blocks is fully compatible with both Timber 1.x and Timber 2.x versions.

timber-acf-wp-blocks's People

Contributors

palmiak avatar szepeviktor avatar badabingbreda avatar dylanjameswagner avatar jdamner avatar

Watchers

 avatar

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.