diff --git a/config/services.yaml b/config/services.yaml index d99dcfa..c69769d 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -18,3 +18,5 @@ services: tags: - { name: kernel.event_listener, event: pimcore.bundle_manager.paths.css, method: addCSSFiles } - { name: kernel.event_listener, event: pimcore.bundle_manager.paths.js, method: addJSFiles } + + Neusta\Pimcore\AreabrickConfigBundle\Twig\NeustaExtension: ~ diff --git a/src/Twig/NeustaExtension.php b/src/Twig/NeustaExtension.php new file mode 100644 index 0000000..069f384 --- /dev/null +++ b/src/Twig/NeustaExtension.php @@ -0,0 +1,28 @@ + $v) { + if ($arrow($v, $k)) { + return true; + } + } + + return false; + } +} diff --git a/templates/bricks/overview.html.twig b/templates/bricks/overview.html.twig index df955bd..f6ce37f 100644 --- a/templates/bricks/overview.html.twig +++ b/templates/bricks/overview.html.twig @@ -1,6 +1,6 @@ -{% set hasVersions = bricks|filter(b => b.version is not empty)|length > 0 %} -{% set hasDescriptions = bricks|filter(b => b.description is not empty)|length > 0 %} -{% set hasAdditionalProperties = bricks|filter(b => b.additionalProperties is not empty)|length > 0 %} +{% set hasVersions = bricks|any(b => b.version is not empty) %} +{% set hasDescriptions = bricks|any(b => b.description is not empty) %} +{% set hasAdditionalProperties = bricks|any(b => b.additionalProperties is not empty) %}