Skip to main content
1 of 2

Enable layout builder on custom controller page

I created a simple page in a controller class:

  public function taxonomyPage($term) {
    return [
      '#type' => 'markup',
      '#markup' => $this->t('<p>Need to render layout builder here.</p>'),
    ];
  }

Routing:

knmt_taxonomy.detail:
  path: '/tags/{term}'
  defaults:
    _controller: '\Drupal\knmt_taxonomy\Controller\TaxonomyController::taxonomyPage'
  requirements:
    _permission: 'edit own content'

For node pages i already use layout builder to render blocks, this is working fine.

I also want to use layout builder within this page. I have zero display options for now, is there a way i can enable layout builder specific for this page so i can render blocks this way?