OrchardCMS/OrchardCore · error · InvalidOperationException
Zone not found while invoking 'render_section':
Error message
Zone not found while invoking 'render_section':
What it means
`render_section` resolved the zone name on the layout, but the zone shape is null or empty. When the tag was invoked with `required:true`, the absence of the zone is treated as a template error and this InvalidOperationException is thrown; otherwise the tag silently renders nothing. It signals that the layout does not contain content for the named zone.
Solutions
- Check the zone name spelling against the layout definition (zones are typically lowercase in Liquid, e.g. 'footer').
- Set `required:false` (or omit it) if rendering the section is optional and an empty zone is acceptable.
- Ensure something actually populates the zone (theme layout, placement, or a module adding shapes to it).
Example fix
// before
{% render_section 'AsideSecond', required:true %}
// after
{% render_section 'AsideSecond', required:false %} Defensive patterns
Strategy: fallback
Validate before calling
{% assign zone = layout.zones[section_name] %}{% if zone == blank %}{% // zone missing: skip or render default %}{% endif %} Try / catch
try { await displayHelper.ShapeExecuteAsync(zone); } catch (InvalidOperationException ex) when (ex.Message.StartsWith("Zone not found")) { /* render nothing or fallback markup */ } Prevention
- Verify zone names against the active theme's layout before marking sections required.
- Use required:false for optional zones and provide default markup when empty.
- Check that the module/feature that populates the zone is enabled.
When it happens
Trigger: `{% render_section name:'SomeZone', required:true %}` where `layout.Zones['SomeZone']` is null or empty — typically a zone no theme/layout ever populated.
Common situations: Copying a template between themes where the target theme never fills that zone; typos in the zone name ('Footter', 'Footer '); custom layouts that removed a zone still referenced by alternates; expecting a zone to exist only when a particular module/feature is enabled.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Cannot override href with other properties
- Format of the link cannot be determined based on the…
- page_title tag requires a segment argument
- render_section tag requires a name argument
- An implementation of 'LiquidTemplateContext' is required
AI-assisted analysis of OrchardCMS/OrchardCore@4306c0717f (2026-09-13).
Data as JSON: /api/errors/59f900a4ecad76e5.
Report an issue: GitHub.
Appendix: source
Thrown at src/OrchardCore/OrchardCore.DisplayManagement.Liquid/Tags/RenderSectionTag.cs:33
var layout = await services.GetRequiredService<ILayoutAccessor>().GetLayoutAsync();
var displayHelper = services.GetRequiredService<IDisplayHelper>();
var arguments = new NamedExpressionList(argumentsList);
var nameExpression = arguments["name", 0] ?? throw new ArgumentException("render_section tag requires a name argument");
var name = (await nameExpression.EvaluateAsync(context)).ToStringValue();
var requiredExpression = arguments["required", 1];
var required = requiredExpression != null && (await requiredExpression.EvaluateAsync(context)).ToBooleanValue();
var zone = layout.Zones[name];
if (zone.IsNullOrEmpty())
{
if (required)
{
throw new InvalidOperationException("Zone not found while invoking 'render_section': " + name);
}
return Completion.Normal;
}
var htmlContent = await displayHelper.ShapeExecuteAsync(zone);
htmlContent.WriteTo(writer, (HtmlEncoder)encoder);
return Completion.Normal;
}
}
View on GitHub (pinned to 4306c0717f)