timber-acf-wp-blocks icon indicating copy to clipboard operation
timber-acf-wp-blocks copied to clipboard

Not working when installed inside roots/bedrock environment

Open mortensassi opened this issue 2 years ago • 3 comments

Thanks for your great extension! Unfortunately when i install the plugin in the root of my bedrock setup, my blocks won't get recognized in the backend. However, installing this plugin inside the theme-directory works. I guess it has something to do with timing and if the Timber-Class exists?

mortensassi avatar Nov 25 '21 17:11 mortensassi

Installing it inside of a theme is the recommended way.

However maybe it could be possible to make it working while installing in the root composer file.

czw., 25 lis 2021, 18:02 użytkownik Moe @.***> napisał:

Thanks for your great extension! Unfortunately when i install the plugin in the root of my bedrock setup, my blocks won't get recognized in the backend. However, installing this plugin inside the theme-directory works. I guess it has something to do with timing and if the Timber-Class exists?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/palmiak/timber-acf-wp-blocks/issues/59, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR34OSOJ7OW3OTAZYZJTQ3UNZT2NANCNFSM5IY7O6FA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

palmiak avatar Nov 25 '21 17:11 palmiak

Yeah you can see bedrock loads first the dependencies but i guess in that moment nor ACF or Timber get recognized. When i think about deployment later, i guess its more suitable when theme-related extensions are part of the theme.

mortensassi avatar Nov 25 '21 18:11 mortensassi

In my bedrock setup it's working with both installation methods (plugin, or directly from autoload)

In my composer

"palmiak/timber-acf-wp-blocks": "^1.15"

don't forget to

composer dump-autoload

after your install

and in my theme

// init timber
$timber = new \Timber\Timber();
// init timber acf blocks
if ( class_exists( 'Timber_Acf_Wp_Blocks' ) ) {
	new Timber_Acf_Wp_Blocks();
   
}

merijnponzo avatar Dec 13 '21 08:12 merijnponzo