Title: 2 Templates?
Last modified: November 29, 2020

---

# 2 Templates?

 *  Resolved [bartezzini](https://wordpress.org/support/users/bartezzini/)
 * (@bartezzini)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/2-templates/)
 * I solved the problem to have 1 template added to the default one. But now I got
   to add a second template to plugin and i tried
 *     ```
       function myRowTemplates( templates ) {
       	templates.push( {
       		name: '1-1',
       		title: '1 Columns (1:1)',
       		icon: 'editor-justify',
       		templateLock: 'all',
       		template: [
       			[
       				'wp-bootstrap-blocks/column',
       				{
       					sizeXs: 1,
       					sizeMd: 4,
       				},
       			],
       		],
       	} );
       	templates.push( {
       		name: '1-2',
       		title: '2 Columns (1:2)',
       		icon: 'editor-justify',
       		templateLock: 'all',
       		template: [
       			[
       				'wp-bootstrap-blocks/column',
       				{
       					sizeXs: 12,
       					sizeMd: 10,
       				},
       			],
       			[
       				'wp-bootstrap-blocks/column',
       				{
       					sizeXs: 12,
       					sizeMd: 2,
       				},
       			],
       		],
       	} );
       	return templates;
       }
       wp.hooks.addFilter(
       	'wpBootstrapBlocks.row.templates',
       	'myplugin/wp-bootstrap-blocks/row/templates',
       	myRowTemplates
       );
       ```
   
 * but it didn’t work. Am I missing something to query?
    -  This topic was modified 5 years, 5 months ago by [bartezzini](https://wordpress.org/support/users/bartezzini/).
    -  This topic was modified 5 years, 5 months ago by [bartezzini](https://wordpress.org/support/users/bartezzini/).

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

 *  Plugin Author [tschortsch](https://wordpress.org/support/users/tschortsch/)
 * (@tschortsch)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/2-templates/#post-13724644)
 * Hi [@bartezzini](https://wordpress.org/support/users/bartezzini/). It looks like
   you’re trying to define a template with the same name as a template which already
   exists by default `name: '1-2'`. Removing the already existing template from 
   the array or choosing another `name` for the new template should solve your issue.
 *  Thread Starter [bartezzini](https://wordpress.org/support/users/bartezzini/)
 * (@bartezzini)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/2-templates/#post-13726780)
 * Thank you a lot [@tschortsch](https://wordpress.org/support/users/tschortsch/).
   
   Works perfectly: you saved my layout 😉 (your plugin is amazing: the dream of
   every plugin user)
 *  Plugin Author [tschortsch](https://wordpress.org/support/users/tschortsch/)
 * (@tschortsch)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/2-templates/#post-13745470)
 * Happy that it helped. We should maybe mention something about the uniqueness 
   of the name attribute in the readme of the plugin.

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

The topic ‘2 Templates?’ is closed to new replies.

 * ![](https://ps.w.org/wp-bootstrap-blocks/assets/icon.svg?rev=2059732)
 * [Bootstrap Blocks](https://wordpress.org/plugins/wp-bootstrap-blocks/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-bootstrap-blocks/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-bootstrap-blocks/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-bootstrap-blocks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-bootstrap-blocks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-bootstrap-blocks/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [tschortsch](https://wordpress.org/support/users/tschortsch/)
 * Last activity: [5 years, 5 months ago](https://wordpress.org/support/topic/2-templates/#post-13745470)
 * Status: resolved