Skip to content

Commit

Permalink
Merge branch 'bugfix/areabrick-name-collisions' into 'v1'
Browse files Browse the repository at this point in the history
allow to disable included areabricks, fixes areabrick name collision issue

See merge request NSD/p_pimcore/bundles/presentationbundle!7
  • Loading branch information
nehlsen committed Sep 26, 2022
2 parents 4500b64 + 1e3ced1 commit 13672cb
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 5 deletions.
9 changes: 9 additions & 0 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ class Configuration implements ConfigurationInterface
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('neusta_pimcore_presentation');

$treeBuilder->getRootNode()
->children()
->booleanNode('bricks')
->defaultTrue()
->end()
->end()
;

return $treeBuilder;
}
}
4 changes: 4 additions & 0 deletions DependencyInjection/NeustaPimcorePresentationExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@ public function load(array $configs, ContainerBuilder $container)

$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('services.yaml');

if ($config['bricks']) {
$loader->load('bricks.yaml');
}
}
}
2 changes: 1 addition & 1 deletion Document/Areabrick/Code.php → DocumentAreabrick/Code.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Neusta\Pimcore\PresentationBundle\Document\Areabrick;
namespace Neusta\Pimcore\PresentationBundle\DocumentAreabrick;

use Pimcore\Extension\Document\Areabrick\AbstractTemplateAreabrick;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Neusta\Pimcore\PresentationBundle\Document\Areabrick;
namespace Neusta\Pimcore\PresentationBundle\DocumentAreabrick;

use Pimcore\Extension\Document\Areabrick\AbstractTemplateAreabrick;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Neusta\Pimcore\PresentationBundle\Document\Areabrick;
namespace Neusta\Pimcore\PresentationBundle\DocumentAreabrick;

use Pimcore\Extension\Document\Areabrick\AbstractTemplateAreabrick;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Neusta\Pimcore\PresentationBundle\Document\Areabrick;
namespace Neusta\Pimcore\PresentationBundle\DocumentAreabrick;

use Pimcore\Extension\Document\Areabrick\AbstractTemplateAreabrick;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Neusta\Pimcore\PresentationBundle\Document\Areabrick;
namespace Neusta\Pimcore\PresentationBundle\DocumentAreabrick;

use Pimcore\Extension\Document\Areabrick\AbstractTemplateAreabrick;

Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ unzip master.zip
rm master.zip
```

## Configuration

The Bundle provides a handful of _simple_ Areabricks to create Presentations. When the Bundle is used alongside other Bundles it might lead to Areabrick name collisions or one is just not interested in using the _default_ Bricks. It is possible to disable the included Areabricks using the following configuration

```yaml
neusta_pimcore_presentation:
bricks: false
```
## Attribution
Icon by <a href="https://www.flaticon.com/free-icons/project" title="project icons">Project icons created by Freepik - Flaticon</a>
19 changes: 19 additions & 0 deletions Resources/config/bricks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
services:
_defaults:
autowire: true
autoconfigure: true

Neusta\Pimcore\PresentationBundle\DocumentAreabrick\Code:
tags: [ {name: 'pimcore.area.brick', id: 'code'} ]

Neusta\Pimcore\PresentationBundle\DocumentAreabrick\Header:
tags: [ {name: 'pimcore.area.brick', id: 'header'} ]

Neusta\Pimcore\PresentationBundle\DocumentAreabrick\Image:
tags: [ {name: 'pimcore.area.brick', id: 'image'} ]

Neusta\Pimcore\PresentationBundle\DocumentAreabrick\Textarea:
tags: [ {name: 'pimcore.area.brick', id: 'textarea'} ]

Neusta\Pimcore\PresentationBundle\DocumentAreabrick\Wysiwyg:
tags: [ {name: 'pimcore.area.brick', id: 'wysiwyg'} ]

0 comments on commit 13672cb

Please sign in to comment.