Issue #1163💬 AnsweredOpened June 4, 2018by agungjanuar0 reactions

How do I set <body> attributes

快速解答by shareefhiasat

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

Read full answer below ↓

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, 2018

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, 2018

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, 2018

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

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.