Skip to content

Commit

Permalink
IBX-8534: Renamed pagelayout parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
ViniTou committed Oct 15, 2024
1 parent 12c6521 commit 942df9f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
6 changes: 2 additions & 4 deletions src/lib/Behat/Context/PagelayoutContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __construct(ConfigResolverInterface $configResolver)
*/
public function aPagelayoutIsConfigured()
{
Assertion::assertTrue($this->configResolver->hasParameter('pagelayout'));
Assertion::assertTrue($this->configResolver->hasParameter('page_layout'));
}

/**
Expand All @@ -50,8 +50,6 @@ public function itIsRenderedUsingTheConfiguredPagelayout()

public function getPageLayout(): string
{
return $this->configResolver->hasParameter('page_layout')
? $this->configResolver->getParameter('page_layout', null, 'site')
: $this->configResolver->getParameter('pagelayout', null, 'site');
return $this->configResolver->getParameter('page_layout', null, 'site');
}
}
7 changes: 3 additions & 4 deletions src/lib/EventListener/ViewTemplatesListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,17 @@ public static function getSubscribedEvents()

/**
* If the event's view has a defined template, sets the view's template identifier,
* and the 'pagelayout' parameter.
* and the 'page_layout' parameter.
*/
public function setViewTemplates(PreContentViewEvent $event): void
{
$view = $event->getContentView();
$pagelayout = $this->configResolver->getParameter('pagelayout');
$pageLayout = $this->configResolver->getParameter('page_layout');

foreach ($this->getTemplatesMap() as $viewClass => $template) {
if ($view instanceof $viewClass) {
$view->setTemplateIdentifier($template);
$view->addParameters(['pagelayout' => $pagelayout]);
$view->addParameters(['page_layout' => $pagelayout]);
$view->addParameters(['page_layout' => $pageLayout]);
}
}
}
Expand Down

0 comments on commit 942df9f

Please sign in to comment.