Issue #1163Opened June 4, 2018by agungjanuar0 reactions

[Question] How do I set <body> attributes

Question

Hi @artf,

On the previous issue #1132 about export <body my="attributes"> code, I think it's done using exportWrapper: true. But now experiencing constraints when it will import attributes from <body>, I try to set attributes does not work. I used importWrapper: true. Any solutions?

Please help and thank you :)

Figure 1: Import tag body with attributes, when I edit code, the attribute is missing image

Answers (3)

shareefhiasatJune 4, 20180 reactions

Hi @agungaja , can you please point the documentation of exportWrapper: true, for some reason i cant find it , i think it may solve me the problem but curious to read its wiki ! Thanks

agungjanuarJune 4, 20180 reactions

yes it is true, I also can not find it. I was only given info by @artf in issue #1132. Or maybe I have a less exploratory documentation 😄.

The point is, why when the content set uses var initcontent = $('#import_html').val(); editor.setComponents(initcontent); the body attribute background-color: #f3f3f3;" disappears

artfJune 6, 20180 reactions

@agungaja there is no importWrapper option and you can't import tag <body>. GrapesJS expect the user to pass the CONTENT... not the WRAPPER (which in most cases is body), the wrapper should be defined by its configuration;

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.