Support » Plugin: Bootstrap Blocks » Custom row types

  • Resolved varilux2k

    (@varilux2k)


    Hi there,

    is it possible to create your own row layouts (actual 1:1, 1:2, 2:1 and 1:1:1)?
    I have learned that I can change the start state via function.php, but I would also like to create a single-column row, or one with 4 columns. I would like to have these to choose while creating the row. Is this possible?

    Best regards
    Varilux2k

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor tschortsch

    (@tschortsch)

    Hi @varilux2k. Yes there is a JavaScript filter for this: https://github.com/liip/bootstrap-blocks-wordpress-plugin#wpbootstrapblocksrowtemplates
    Just create a block-filter.js file with the described filter and enqueue it like this in your function.php:

    function my_block_editor_assets() {
    	wp_enqueue_script(
    		'my-block-editor-js',
    		'path/to/block-filter.js',
    		array( 'wp-hooks' ),
    		'1.0.0',
    		true // Enqueue the script in the footer.
    	);
    }
    
    add_action( 'enqueue_block_editor_assets', 'my_block_editor_assets' );
    

    Hello Tschortsch,

    and thank you for your answer. I tried to play through it once, but unfortunately without success. I’m using an Understrap Child theme and have created a folder called “block-editor”. I put the block-filter.js in this. I think I make a mistake in function.php in which I have to specify the path to the file. Here I enter block-‘editor/block-filter.js’. Is that correct?

    Best regards
    Varilux2k

    Plugin Contributor tschortsch

    (@tschortsch)

    Hi @varilux2k. Sorry for the late answer. You can define the script source like this: get_template_directory_uri() . '/block-editor/block-filter.js' (if this file is part of your theme). If this doesn’t help can you check if the block-filter.js script gets loaded when you open the editor? (in the network tab of the dev tools)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom row types’ is closed to new replies.