Home › Forums › Gutenberg › Inserter Help Panel › Reply To: Inserter Help Panel
I actually just revised my code a little. The field to receive the preview data needs to be in the template. I built a repeater with ACF to register the blocks. The acf field doesn’t even need to exist within the block fields, weird but it works.
so…
'example' => array(
'attributes' => array(
'mode' => 'preview',
'data' => array(
'gutenberg_preview' => __('<img src="https://via.placeholder.com/680x720">'),
),
)
)
Then in the template…
<div data="gutenberg-preview-img"><?php the_field('gutenberg_preview'); ?></div>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.