MissingContentForLayout
MissingContentForLayout
Severity: error | Type: LiquidHtml
{{ content_for_layout }} is where platformOS injects the rendered page body. A layout that never references it renders its own chrome but drops the page content entirely — a correctness defect, not a style issue.
This check runs only on layout files (app/views/layouts/ and module layout directories); pages and partials are never flagged. Any reference to the content_for_layout variable clears the check, whether it is emitted with {{ ... }}, {% echo ... %}, or inside a {% liquid %} block.
Note that named slots rendered with {% yield 'name' %} are a separate mechanism and do not substitute for {{ content_for_layout }}.
Examples
✗ Incorrect Code Example (Avoid using this):
<!doctype html>
<html>
<body>
<header>My Site</header>
{% yield 'footer' %}
</body>
</html>
✓ Correct Code Example (Use this instead):
<!doctype html>
<html>
<body>
<header>My Site</header>
{{ content_for_layout }}
{% yield 'footer' %}
</body>
</html>
Configuration
The default configuration for this check:
MissingContentForLayout:
enabled: true
severity: error
Disabling This Check
This check should not be disabled — a layout without {{ content_for_layout }} silently drops the page body of every page rendered with it.
Suggestions
This check offers a suggestion (available as a quick-fix in your editor): insert {{ content_for_layout }} before the closing </body> tag, or at the end of the layout when it has no <body> element.