Provide Sulu twig template attributes in your controller ======================================================== In order to use the ``base`` template that is used for pages on custom routes, you need to provide the correct attributes to your template. To do this, you can use the``TemplateAttributeResolver`` service in your controller: .. code-block:: php render( 'static/custom.html.twig', $resolver->resolve([ 'customAttribute' => 'parameter', ]) )); // Cached response: $response->setPublic(); $response->setMaxAge(240); $response->setSharedMaxAge(240); // Server Cache Lifetime (how long the server should cache the page in seconds) $response->headers->set(SuluHttpCache::HEADER_REVERSE_PROXY_TTL, '604800'); // 604800 seconds = 1 week // Uncached response private response (for controller containing user specific data): // $response->setPrivate(); // $response->setMaxAge(0); // $response->setSharedMaxAge(0); // $response->headers->addCacheControlDirective('no-cache', true); // $response->headers->addCacheControlDirective('must-revalidate', true); // $response->headers->addCacheControlDirective('no-store', true); return $response; } } Now your ``templates/static/custom.html.twig`` can use the same base template as your pages: .. code-block:: twig {% extends "base.html.twig" %} {% block content %} {{ customAttribute }} {% endblock %}