-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block not being rendered #43
Comments
It looks OK.
Could you also show me your folder structure and the code you used for
timber/acf-gutenberg-blocks-templates ? Maybe you found some edge case.
wt., 19 sty 2021, 23:57 użytkownik Mitchell Jackson <
[email protected]> napisał:
… I have added my block template in my own folder and used
'timber/acf-gutenberg-blocks-templates' to assign it to my custom folder I
can see the block it in the Gutenberg editor and add content to it however
the block is not being rendered on my homepage.
`{#
Title: Hero
Description: Add hero to a page
Category: formatting
Icon: editor-paste-text
Keywords: hero
#}
{{ fields.hero_title }}
{{ fields.hero_text }}
`
`{% extends 'layouts/base.twig' %}
{% block body %}
{{ post.content }}
{% endblock body %}`
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#43>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAR34OTR4I45N66CI7AEEVDS2YE6BANCNFSM4WJVFDTQ>
.
|
functions.php
I'm using a starter theme called JackPine |
Got it - will test tomorrow and try to reproduce 👍
śr., 20 sty 2021, 00:26 użytkownik Mitchell Jackson <
[email protected]> napisał:
… [image: Screenshot 2021-01-19 at 11 22 42 pm]
<https://user-images.githubusercontent.com/2472850/105106127-65482100-5aad-11eb-8261-32561d8ebc9d.png>
*functions.php*
<?php
/**
* Jackpine
*
* Based on the Timber starter theme.
* Huge thanks to the folks who made the tools that Jackpine is built on.
*
* @Package WordPress
* @subpackage Jackpine
* @SInCE Jackpine 0.1.0
*/
require_once dirname( __DIR__ ) . '/vendor/autoload.php';
function add_to_context( $context ) {
$context['primary_menu'] = new Timber\Menu('Primary');
$context['footer_menu'] = new Timber\Menu('Footer');
return $context;
}
add_filter('timber/acf-gutenberg-blocks-templates', function () {
return ['../assets/templates/blocks'];
});
add_filter( 'timber/context', 'add_to_context' );
use Jackpine\JackpineSite;
new JackpineSite( 'jackpine', '0.11.0', '../dist', '../assets/templates' );
I'm using a starter theme called JackPine
<https://github.com/45-North-Ventures-LLC/jackpine>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#43 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAR34OUX4W7JVAEC4FVR6CTS2YIKTANCNFSM4WJVFDTQ>
.
|
One more thing - which ACF version and which Gutenberg version (plugin or the one built in core)? |
I'm using the composer versions of ACF on version 5.9.3 I'm using the core version of Gutenberg on WordPress 5.6 also using bedrock if that's any help. |
So I was able to replicate it and I understand why this is happening. I even have a plan how to fix it. Overall this is caused by the structure - Timber::$dirname is set to I'm thinking about adding (this a rough draft, as it doesn't respect the $dirname as array yet) something like this:
I have to finish working with one PR and I'll try to fix this. |
Thanks for the update it makes sence now. Is there a quick and dirty way of getting it working? |
Adding:
after:
and remove the previous return. As a quick and dirty it should work ;) |
Got it working thanks 👍 |
I have added my block template in my own folder and used 'timber/acf-gutenberg-blocks-templates' to assign it to my custom folder I can see the block it in the Gutenberg editor and add content to it however the block is not being rendered on my homepage.
templates/blocks/hero.twig
pages/page.twig
The text was updated successfully, but these errors were encountered: