MWDelaney / sage-acf-wp-blocks

Composer library for generating ACF Gutenberg blocks from templates. Intended for use with Roots/Sage (http://roots.io)
346 stars 66 forks source link

Question about displaying block content on site #74

Closed RobDobsonNC closed 1 year ago

RobDobsonNC commented 1 year ago

Hello - I'm a bit new to sage/blocks, coming back into WP dev after a few years away. I've installed everything, and a new block is correctly appearing within the WYSIWYG editor of ACF.

Nothing though is appearing on the page once saved - which is the bit I'm missing?

And also - apologies - what goes in this section in the definition?

  EnqueueStyle: styles/style.css
  EnqueueScript: scripts/script.js
  EnqueueAssets: path/to/asset

Thank you so much for any help. I'm sure it's something obvious

robmeijerink commented 1 year ago

Recently, Sage migrated to Bud from Laravel Mix. When these headers were added, Laravel Mix was still the default. It used to work by putting the path to the public file in there. When the block was used in the page, the given asset would load.

However, now that Sage uses Bud, this part is broken with the recent Sage versions. Bud uses bundlenames registered in bud.config.js and not file paths to register assets. I made a PR #75, so we can register Bud assets by using the bundle name. However, we have to wait till this is approved and merged before we can use it again.

For now, unfortunately this plugin will not work with assets built by Bud.

RobDobsonNC commented 1 year ago

Thanks!