I am trying out ACF Pro to build a custom carousel block and am looking to pass the user selected option’s value to the init js file.
Something like this:
var initializeBlock = function ($block) {
$block.find('.gallery-carousel').flickity({
cellAlign: $value_selected_for_the_block,
});
};
My current code is similar to https://www.advancedcustomfields.com/blog/building-a-custom-slider-block-in-30-minutes-with-acf/.
Any idea?
Solved by sending the field value as a data attribute and accessing it in the JS file.