- Issue created by @fathershawn
- Merge request !13283Resolve #3544632 "Return only main content on designated routes" β (Open) created by fathershawn
When we intentionally build responses to service HTMX requests it is the main content that we want to send. We don't want or need all the surrounding blocks that Drupal generates. In such cases we need to be able to produce a simple response with the main content.
Use the new renderer created in π Return htmx responses as SimplePageVariant Active to render these responses.
Two possibilities occur to us to signal the use of this renderer when building a service to return fragments or html intentionally built for htmx requests.
\Drupal\Core\EventSubscriber\MainContentViewSubscriber
which selects this renderer if the route is designated as an _htmx_route
. MainContentViewSubscriber
already has the current RouteMatch
available which makes this a straightforward change.HtmxResponse
object and find the right point in the response process to select the renderer.None.
None.
_wrapper_format=drupal_htmx
to the query string._htmx_route
.HtmxRenderer
which renders the main content and required CSS/JS assets in the simplest HTML document.None at this time.
Needs work
11.0 π₯
request processing system