• Resolved thePixelPixie

    (@yourbusybee)


    Using the Block Types feature for the first time. It’s GREAT! I was able to enqueue a local version of Bootstrap css and js. But the bootstrap animation doesn’t seem to be launching inside the editor. I can live with that, but would love to understand “Enqueue Assets”. I can’t find any examples of what would go in this field. Would I be able to use that to enqueue all the styles and scripts I load from functions for my theme? I would love to be able to do that instead of linking to bootstrap files on my site (I use the CDN version for my themes).

    Thanks in advance.

Viewing 1 replies (of 1 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Thanks for the feedback!

    The ACF Extended Block Type module is just an UI that use the native acf_register_blockt_type() behind the scene. That’s why you’ll find all the settings in the UI as in the ACF Block Types documentation.

    In order to enqueue multiple assets, you can use the Enqueue assets setting. In this setting, you can simply write the name of a PHP function, for example my_block_assets, and then write that function in your theme’s functions.php file in order to enqueue multiple files. For examples:

    function my_block_assets(){
        
        wp_enqueue_style('block-testimonial', get_template_directory_uri() . '/template-parts/blocks/testimonial/testimonial.css');
        wp_enqueue_script('block-testimonial', get_template_directory_uri() . '/template-parts/blocks/testimonial/testimonial.js', array('jquery'), '', true);
        
    }
    

    Hope it helps!

    Have a nice day!

    Regards.

Viewing 1 replies (of 1 total)
  • The topic ‘Enqueue more than one script for blocks’ is closed to new replies.