- 🇳🇿New Zealand danielveza Brisbane, AU
This can check if the current route is using layout builder with code like this stripped back example
$parameters = $this->routeMatch->getParameters(); if ($parameters->has('section_storage')) { if ($parameters->get('section_storage') instanceof SectionStorageInterface) { return TRUE; } return FALSE; }
Then in a preprocess you can add a class if that returns TRUE.
I'm -1 of building something like this into core, I think it's something that can be quite easily added on a site by site basis, or it could be a contrib module.
Postponing for others to give thoughts
- 🇨🇦Canada joelpittet Vancouver
Closing as a duplicate for this issue (thanks @larowlan and @eclipsegc)
#3273317: Add 'in_preview' variable to block and layout templates → - Status changed to Closed: duplicate
11 months ago 11:45pm 20 June 2024