Issue #1538Opened October 24, 2018by Geelik0 reactions

Different content when exporting

Question

Hi,

I'm trying to use grapejs with dynamic contents. What i want to achieve is like wordpress, i want to have shortcodes / custom html tag when i export html.

So here is an example of what i mean :

<!-- inside the editor -->
<div data-type="my-component">My component content here</div>
<!-- this is what i want when i export-->
<my-component>My component content here</my-component>

So for that i use components, i have tried to do this.model.set('tagName'', 'div') inside the render method in my component view but it does an infinite loop cause modifying the model trigger the render method.

If you have any tips for me.

Answers (2)

artfOctober 30, 20180 reactions

@Geelik you can set the tagName in Component definition

lock[bot]October 30, 20190 reactions

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

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.