Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter benjaminsc

    (@benjaminsc)

    Thx! Keep up the good work and have a nice weekend!

    Thread Starter benjaminsc

    (@benjaminsc)

    Hi @tschortsch,

    changing the line to

    wp.hooks.addFilter( ‘wpBootstrapBlocks.row.templates’, ‘vrmagic/wp-bootstrap-blocks/row/templates’, myRowTemplates );

    solved my problem, thanks for your fast help!!! The new template structure now appears in the WP editor. I copied the original line without the ‘wp.hooks’ from this thread ( https://www.ads-software.com/support/topic/few-ideas/ )
    and obviously didn’t check it for erros – my fault.

    One new issue has ocurred: When I add an icon to my template from above, the template is ignored. If I remove the icon, the template is displayed. Here is how I added the icon:

    wp.hooks.addFilter( 'wpBootstrapBlocks.row.useOldObjectTemplateStructure', 'vrmagic/wp-bootstrap-blocks/row/useOldObjectTemplateStructure', () => false );
    
    function myRowTemplates( templates ) {
        templates.push( {
            name: '2-1-1',
            title: '3 Columns (2:1:1)',  
            icon: <SVG width="48" height="48" viewBox="0 0 48 48" xmlns="https://www.w3.org/2000/svg"><Path fillRule="evenodd" clipRule="evenodd" d="M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H25V34H39ZM23 34H9V14H23V34Z" /></SVG>,
            templateLock: 'all',
            template: [
    			[
    				'wp-bootstrap-blocks/column',
    				{
    					sizeMd: 6,
    				},
    			],
    			[
    				'wp-bootstrap-blocks/column',
    				{
    					sizeMd: 3,
    				},
    			],
    			[
    				'wp-bootstrap-blocks/column',
    				{
    					sizeMd: 3,
    				},
    			],
    		],
        } );
        return templates;
    }
    
    addFilter( 'wpBootstrapBlocks.row.templates', 'vrmagic/wp-bootstrap-blocks/row/templates', myRowTemplates );

    However, this is not important for me, I can live without the icon if you do not have a quick answer. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)