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)
You can do it by updating the i18n string
grapesjs.init({
...,
i18n: {
messages: {
en: {
domComponents: {
names: {
'': 'Responsive Container', // default has an empty key
}
}
}
}
}
})
Outstanding! Thanks.
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.
Issue #2065
Few Questions
First of all, Amazing project thumbs up to everybody involved. I have a couple of questions:How can I iterate over all of the components an...
Issue #2696
[QUESTION]: How can I create block with background image with behavior like built-in "image"?
Hello, I'm trying to create block with background image (similar to Grapedrop Image Box). I added new component like this: And also I added...
Issue #859
[QUESTIONS] Change canvas style
Hi there, I have some question about canvas style, in this case i have config like this. By default i use css with name builder-desktop.css...
Issue #2404
Question: how to observe children changes in component
Is there an easy way to subscribe/listen to changes in the components/children of my custom component type? Perhaps an event I can subscrib...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.