Skip to content

Commit

Permalink
Merge pull request #9 from netgen-layouts/page-target-resource-type-c…
Browse files Browse the repository at this point in the history
…ondition-support

Add support for page target type and resource type condition type
  • Loading branch information
emodric authored Nov 13, 2023
2 parents 1c1dc24 + 58d141f commit b3c0de6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public function load(array $configs, ContainerBuilder $container): void
public function prepend(ContainerBuilder $container): void
{
$prependConfigs = [
'netgen_layouts_sylius.yaml' => 'netgen_layouts_sylius',
'liip_imagine.yaml' => 'liip_imagine',
'block_definitions.yaml' => 'netgen_layouts',
'block_type_groups.yaml' => 'netgen_layouts',
Expand Down
1 change: 1 addition & 0 deletions bundle/EventListener/BitBag/PageIndexListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public function onPageIndex(ResourceControllerEvent $event): void
}

$currentRequest->attributes->set('nglayouts_sylius_bitbag_section', $section);
$currentRequest->attributes->set('nglayouts_sylius_resource', $section);
// We set context here instead in a ContextProvider, since bitbag_sylius_cms_plugin.page.index
// event happens too late, after onKernelRequest event has already been executed
$this->context->set('bitbag_section_id', (int) $section->getId());
Expand Down
8 changes: 8 additions & 0 deletions bundle/Resources/config/netgen_layouts_sylius.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
resource_type_condition:
available_resources:
BitBag\SyliusCmsPlugin\Entity\PageInterface: page
BitBag\SyliusCmsPlugin\Entity\SectionInterface: section

page_target:
available_pages:
bitbag_sylius_cms_plugin_shop_frequently_asked_question_index: frequently_asked_questions

0 comments on commit b3c0de6

Please sign in to comment.