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)
@Geelik you can set the tagName in Component definition
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.
Issue #1733
How to remove script tag which is added by add block manager script
Hello @artf I want to export final/production based html content excluding the script(Only which is added by block manager). Suppose i am a...
Issue #460
When the component's view modifies the HTML, text components are no longer editable
I'm trying to build a custom component that contains some lorem ipsum text in the content, for editing once it's on the canvas. But I also...
Issue #1206
Issue : Adding scripts inside nested content showing different behavior when compared with a single content ta
Hi , We are actually trying to add a own JS script that can read a file and preview the same on the html. But in doing so by adding a Block...
Issue #1363
Problem trying to inject new HTML content in the Editor
Hi @artf, I'm now working on doing content in multi-languages inside the editor but I would like to know how can I save in the Dom HTML new...
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.