Issue #1753πŸ’¬ AnsweredOpened Jan 24, 2019by arachnosoft0 reactions

StyleManager - SectorsView - addToCollection() uses "name" attribute to build the ID and fails with several spaces or special characters

Quick answerby arachnosoft

Here is the screenshot I mentioned earlier:

Read full answer below ↓

Question

Hi @artf , Using the pluginOpts property from the grapesjs.init() method, I customized the sectors displayed on the Style Manager (through the Newsletter plugin), like this: The goal being to translate the labels into another language. But I found that the "name" property is also used... to build the id attribute of each sector's HTML tag, with a custom prefix, like "gjs-<namePropertyInLowercase>". The problem being when "name" contains several spaces: only the first one is being replaced, leading to an invalid HTML id attribute (with spaces), which can't be targeted through CSS to apply some...

Answers (3)

arachnosoftβ€’ Jan 24, 2019

Here is the screenshot I mentioned earlier:

grapesjs id attribute bug report

artfβ€’ Jan 27, 2019

If using the "name" attribute is intentional here, and not a copy/paste mistake (in case you meant model.get('id') instead of model.get('name')), what's the purpose of this? Rather than using, say, an "id" property we could define ourselves? (and naturally avoiding to use any spaces or special char...

lock[bot]β€’ Jan 27, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

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...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

Premium plugins ship with support, regular updates, and production-ready features β€” save days of integration work.

Browse premium plugins β†’

Related tutorials

In-depth guides on the same topic.

All tutorials β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.