This commit is contained in:
2026-09-15 10:35:56 +08:00
commit 782f8ea7aa
4086 changed files with 631288 additions and 0 deletions
@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace Esun\CmsLayout\Observer;
use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\View\Page\Config as PageConfig;
class ApplyCustomFullWidthLayout implements ObserverInterface
{
private const PAGE_LAYOUT = 'cms-custom-full-width';
public function __construct(
private readonly PageConfig $pageConfig
) {
}
public function execute(Observer $observer): void
{
if ($observer->getEvent()->getFullActionName() !== 'cms_page_view'
|| $this->pageConfig->getPageLayout() !== self::PAGE_LAYOUT
) {
return;
}
$this->pageConfig->addBodyClass('cms-custom-full-width');
$this->pageConfig->addPageAsset('Magento_Theme::css/cms-custom-common.css');
$observer->getEvent()->getLayout()->unsetElement('breadcrumbs');
}
}