Issue #2482Opened December 31, 2019by andrewryan19060 reactions

How do I change the name of the default component?

Question

I noticed everywhere in the canvas "Box" is the term for the default container. I'd like to change that

I found the customLabel strategy function on the canvas; that works, but as soon as I implement it, I lose the default behavior for labelling everywhere else in the template designer. Don't want that.

Really, what I just want to do is change the name of the "default" container so that the badge appears as "Responsive Container."

What's the best way to do that?

Andrew

Answers (3)

artfJanuary 2, 20200 reactions

You can do it by updating the i18n string

grapesjs.init({
	...,
	i18n: {
		messages: {
          en: {
            domComponents: {
              names: {
                '': 'Responsive Container', // default has an empty key
              }
            }
          }
        }
	}
})
andrewryan1906January 2, 20200 reactions

Outstanding! Thanks.

andrewryan1906January 6, 20200 reactions

Hey... this works, but nulls out all of the other names. How do I override just that name?

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.