I’m trying to keep the entire <head> section within a Content Fragment, so I created a dedicated CF and included it in the content template. However, after saving and reopening, the CF is automatically moved from the <head> tag to the <body> tag.
Before save,
<!DOCTYPE html>
<html data-qb-installed="true">
<head>
<meta charset="utf-8" />
{{fragment id='ajo:ce84ac85-7f5b-4385-84cf-f3c850da8140' mode='inline'}}
<header></header>
<div>test</div>
</body>
</html>
When I reopen the same,
<!DOCTYPE html>
<html data-qb-installed="true">
<head>
<meta charset="utf-8" />
</head>
<body class="is-html-mode" contenteditable="true">
{{fragment id='ajo:ce84ac85-7f5b-4385-84cf-f3c850da8140' mode='inline'}}
<header></header>
<div>test</div>
</body>
</html>
The inserted Content Fragment is being moved from the <head> tag to the <body> tag after saving. Is it not possible to insert a Content Fragment within the <head> section
Views
Replies
Total Likes
@Mario248 Yes.
Thank you for the detailed response.
The reason I created a Content Fragment was to include custom meta tags within the <head> section, which also contains CSS references. My goal is to keep all CSS and meta details in a separate Content Fragment so that they can be managed easily without modifying the actual body content.
However, I’m wondering if this approach aligns with best practices. Is it recommended to maintain CSS in a separate file and reference it instead? If using a Content Fragment isn’t the right approach, where is the best place to maintain and include CSS within a Content Template? What’s the recommended best practice for managing CSS in this context?
Views
Replies
Total Likes