Head tag data displaying in body and head is showing empty
Question
Hi Artf there is head tag and meta tags in my head tag of HTML i am assigning to editor components. Like
<!DOCTYPE html>
<html lang="en">
<head>
<base id="base" href="http://127.0.0.1:8000/storage/projects/1/c8FRWF5tjAYqNralxABnigDX7qCUSR1KhnRK/">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
</head>
<body>
........
</body>
</html>
But it is displaying <head> content in body of iframe like
<iframe allowfullscreen="allowfullscreen" class="gjs-frame">
<html>
<head></head>
<body class="gjs-dashed">
<style>....</style>
<div id="wrapper" data-highlightable="1">
<base id="base" href="http://127.0.0.1:8000/storage/projects/1/c8FRWF5tjAYqNralxABnigDX7qCUSR1KhnRK/" data-highlightable="1">
<meta charset="utf-8" data-highlightable="1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" data-highlightable="1">
<meta name="viewport" content="width=device-width, initial-scale=1" data-highlightable="1">
<meta name="description" content="" data-highlightable="1">
<meta name="author" content="" data-highlightable="1">Other Content </div>
</body>
</html>
</iframe>
Answers (2)
GrapesJS is not designed to handle stuff outside of the body, indeed all the content are appended inside the body. So, for example, if you're creating a Page Builder you use GrapesJS for creating the template of the page NOT its metadata, that part should be handled outside
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 #1770
[Bug] Components with custom tag are not rendered if specified in theme body
Hello I created very simple skeleton of GrapesJS editor. HTML template: Javascript: Result of loading: As you see, component is not rendere...
Issue #1746
[FEATURE REQUEST] Don't Strip off html , head and body tags from imported html
Hi Team, We have noticed grapesjs has customised the actual template uploaded, by stripping off the html, head and body tags and adds new s...
Issue #563
Table <thead> and <tbody> tag gets Omitted
Hello, There is new issue with GrapesJS (maybe). I've created new component using bm.add() in which I've used a table element with <thead>...
Issue #1132
[Question] How do I get <body> tag and its attributes
I have set the background-color for body. But when it will be edit code or export data using command editor.runCommand ('gjs-get-inlined-ht...
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.