# How to register Gutenberg blocks using acf_register_block_type

**URL:** https://discourse.roots.io/t/how-to-register-gutenberg-blocks-using-acf-register-block-type/23569
**Category:** sage
**Tags:** sage10
**Created:** 2022-07-15T17:57:09Z
**Posts:** 3

## Post 1 by @powen-cs — 2022-07-15T17:57:09Z

Have read up on using plugins to register blocks in Sage 10 but I was wondering if there is a way to register Guternberg blocks using the more traditional method of acf\_register\_block\_type.

So far, I’ve created a new file: acf-blocks.php in the /app folder and have the acf/init action to register them. So an example would be:

```
/resources/views/blocks/banner.php
```

And have registered it successfully with:

```
acf_register_block_type(array(
        'name' => 'banner',
        'title' => __('Banner'),
        'description' => __('Banner Block'),
        'render_template' => \Roots\view('blocks.banner')->render(),
        'category' => 'media',
        'icon' => 'images-alt2',
        'supports' => array('align' => array('wide')),
        'align' => 'wide'
      ));
```

The blocks are registered in the CMS fine and I can use them in the editor, however they are not rendering in the front-end and I’m sure the render\_template isn’t right.

I’ve searched and tried numerous paths to no avail. Is there anyone who has successfully got their blocks working in the front-end using this way of registering acf blocks?

I don’t mind it they have to run as Blade or not. Any help would be appreciated. :+1:t2:

---

## Post 2 by @powen-cs — 2022-07-18T12:42:50Z

I sorted this with the following line:

```
'render_template' => config('theme.dir') . '/resources/views/blocks/banner/banner.php',
```

---

## Post 3 by @adamalexanderw — 2022-07-20T13:33:22Z

Just to add to this, make sure you are calling a standard php file in `'render_template'` and not a `.blade.php` like I was :grin:
