Placing content in different regions using a controller I've defined a route to a custom controller, which returns a render array to define its content. By default, this content gets rendered entirely inside the main content region of the page: what I want is to have different parts of it rendered to different regions.

I've tried specifying the region (e.g. '#region' =&gt; 'content_intro') in the relevant sub-arrays for different elements, but they are still output to my main content region.

I've also then tried adding the following to the base definition of the returned render array:

$content = array(
  '#type' =&gt; 'page',
);


This does then allow me to successfully specify the region for placing individual elements. However, other standard elements placed in page regions - specifically, a navigation menu block - are then not output.

How would I best go about having my controller add its content to regions, while still retaining elements placed by other systems?
The normal way to do this is to provide the main content in a controller and the additional content in block plugins.

If you don't want to use blocks and the block layout for this task (what you really should do!), and want to solve this in code, you can use a preprocess hook to add content your module provides in a function (procedural or static, not a controller) to a region.