getThemeInformation = $getThemeInformation; } /** * Add theme vendor and theme name handles. * * @param \Magento\Framework\Event\Observer $observer */ public function execute(Observer $observer) { /** @var \Magento\Framework\View\Layout\ProcessorInterface $update */ $update = $observer->getEvent()->getLayout()->getUpdate(); $update->addHandle($this->createLayoutName($this->getThemeInformation->getVendor())); $update->addHandle($this->createLayoutName($this->getThemeInformation->getName())); } /** * Build layout name. * * @param string $string * @return string */ private function createLayoutName(string $string): string { return self::LAYOUT_PREFIX . str_replace('-', '_', $string) . '_default'; } }