Support

Account

Home Forums ACF PRO Register multiple blocks with new JSON method?

Unread

Register multiple blocks with new JSON method?

  • Sorry I must be missing something. Trying to learn the new JSON method to register blovks. I can get one working but for the life of me I cant figure out how to register a second one. Do it add it to the block.jsonf file or do u register another directory with:

    
    add_action( 'init', 'register_acf_blocks' );
    function register_acf_blocks() {
        register_block_type( __DIR__ . '/blocks/image-overlay-bar' );
    }
    

    Also is there a way to group blocks in a the block.json and have the render templates in a same folders. I have a few of these blocks that depend on other parent blocks and by storing them in a folder and registering them all in the same json file would be very convenient.

    Some examples would be:
    1) Multiple sliders using the SwiperJs. A parent container block. Child Slide block using inner blocks.
    2) a timeline block set with the same method. A parent container block and child timeline events block w/ innerblocks..

    Thanks any info to clear this up. or documentation leads.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.