If you want to show a block within the content region of your Drupal 8 site, this may be the module for you. Specifically, if you would like to print the secondary menu region mixed in among the fields of your content in your custom full node template, we've got you covered.
This module is based on the code provided by Brian Gervais in the blog post Making region content available to node templates in Drupal 8.
Currently, it is hard-coded to providing the secondary menu as a variable available in content templates for the Full view mode only. If the functionality is useful to anyone else but a different region is needed, or you need to get the variable into a paragraph template or some other variation, this module would like to extend to support that in a flexible, configurable way. Code or encouragement is welcome!
Install with Composer (recommended)
composer require drupal/regionincontent
Example usage
In your node--full.html.twig file you can now use the secondary_menu variable, such as like this:
{# Header hero region #}
<section{{ attributes.addClass(classes) }} data-headerbg="{{ headerbg }}">
<div class="hero-body">
<div class="container">
<div class="titlebar">
<div class="titlebar_title">
<h1 class="title is-2">{{ label }}</h1>
</div>
{% if secondary_menu|render %}
<div class="titlebar_links">
{{ secondary_menu }}
</div>
{% endif %}
</div>
{% if content.field_authors is not empty %}
<p class="byline is-mono">Written by {{ content.field_authors }}</p>
<p class="byline is-mono">Posted on {{ date }}</p>
{% endif %}
</div>
</div>
</section>
This requires, of course, that you have a separate secondary level menu to display (or you throw something else in the "Secondary Menu" region; we won't judge). Having the second (or third) level of your menu is completely possible in Drupal 8 without any contributed modules, but it is not particularly intuitive. Here's how to do it:
- Place block Main navigation from category Menus in the Secondary menu region.
- Give it a Title to distinguish it from the existing Main navigation block, something creative like Second-level main navigation.
- Open the collapsed Menu levels section of the configuration and change the Initial visibility level to 2. Set the Number of levels to display to 1.
This will show only the second-level main menu links in this block. Configure the likely already-existing Main navigation block to have an initial visibility level of 1 and a number of levels to display to be also 1.
If you want a third level menu links to display, adjust these to your taste (with either the original block or the second-level block displaying an additional level, and the initial level of the second block changing if needed) or add a third block with initial visibility level of 3.
Project information
- Project categories: Content display, Developer tools
23 sites report using this module
- Created by mlncn on , updated
Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
Drupal 10 compatibility.
Development version: 8.x-1.x-dev updated 4 Sep 2025 at 23:59 UTC

