Issue #1960šŸ’¬ AnsweredOpened April 10, 2019by davydav0 reactions

Dynamic class generation with a template

Quick answerby artf

Hi Davy, if you need a class you can set it already in your template, if you need a dynamic one, probably you would make use of events like component:add or block:drag:stop

Read full answer below ↓

Question

Hi there ! I am wondering if there is a way to force the dynamic class generation (of the form cXXXXX which happens when I drag'n'drop a component) at template import ? The problem is, when I use a template, the generated components in the editor don't have that dynamic class, which I need to be able to generate media queries while editing in the phone/tablet modes. For reference, here is the template I am importing : https://gist.github.com/davydav/2413f5fdaa154a80dfa49a633bd247bb Thanks a lot for your awesome work !

Answers (3)

artf• April 13, 2019

Hi Davy, if you need a class you can set it already in your template, if you need a dynamic one, probably you would make use of events like component:add or block:drag:stop

davydav• April 23, 2019

Thank you for your answer ! Is there anyway to access your method of class generation, or could you point me to where it is in your code ? I've been trying to find it but no luck ! Thanks again

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.