PHPackages                             khusseini/pimcore-radbrick - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. khusseini/pimcore-radbrick

AbandonedArchivedPimcore-bundle[Utility &amp; Helpers](/categories/utility)

khusseini/pimcore-radbrick
==========================

A RAD way to create areabricks in Pimcore

1.x-dev(5y ago)2211[3 PRs](https://github.com/khusseini/PimcoreRadBrickBundle/pulls)BSD-2-ClausePHPPHP &gt;=7.3

Since Apr 22Pushed 5y ago2 watchersCompare

[ Source](https://github.com/khusseini/PimcoreRadBrickBundle)[ Packagist](https://packagist.org/packages/khusseini/pimcore-radbrick)[ RSS](/packages/khusseini-pimcore-radbrick/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelogDependencies (8)Versions (7)Used By (0)

[![Build Status](https://camo.githubusercontent.com/4982099b73f24202e8694e278d5c1b98d3bacd8054aa3ccbec87f0f52a4119a6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b6875737365696e692f50696d636f7265526164427269636b42756e646c652f6261646765732f6275696c642e706e673f623d312e78)](https://scrutinizer-ci.com/g/khusseini/PimcoreRadBrickBundle/build-status/1.x)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/3d66052584c33aa75f14f83e36da11c08b6bca30be1544902af805059a53bd45/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b6875737365696e692f50696d636f7265526164427269636b42756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d312e78)](https://scrutinizer-ci.com/g/khusseini/PimcoreRadBrickBundle/?branch=1.x)[![Coverage Status](https://camo.githubusercontent.com/9431c7ade7349fe2437e576ff3ab4a700cd6444825075af703b65bb89a8a69c2/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6b6875737365696e692f50696d636f7265526164427269636b42756e646c652f62616467652e7376673f6272616e63683d312e78)](https://coveralls.io/github/khusseini/PimcoreRadBrickBundle?branch=1.x)[![License](https://camo.githubusercontent.com/4fa8b554930878c6bc41c1b9cac5e52e358f665f0277d89dcb1e3d998e7ec8db/68747470733a2f2f706f7365722e707567782e6f72672f6b6875737365696e692f70696d636f72652d726164627269636b2f6c6963656e7365)](https://packagist.org/packages/khusseini/pimcore-radbrick)[![Code Intelligence Status](https://camo.githubusercontent.com/3b928e8a84b6ffd9ff4888f1d74eeb6adb4b21da5da22d0bcf8ee46533f375cd/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b6875737365696e692f50696d636f7265526164427269636b42756e646c652f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d312e78)](https://scrutinizer-ci.com/code-intelligence)[![Infection MSI](https://camo.githubusercontent.com/bb2d3edb54c656d5f8449c1c1f40ca4fbdac2502d86cc6714542f1b1d4b5052b/68747470733a2f2f62616467652e737472796b65722d6d757461746f722e696f2f6769746875622e636f6d2f6b6875737365696e692f50696d636f7265526164427269636b42756e646c652f312e78)](https://infection.github.io)

PimcoreRadBrickBundle
=====================

[](#pimcoreradbrickbundle)

A RAD way to create Areabricks in Pimcore

Purpose
-------

[](#purpose)

Configure data and editables available in Pimcore Areabricks view and edit templates.

Installation
------------

[](#installation)

```
composer require khusseini/pimcore-radbrick

```

Usage
-----

[](#usage)

Simply enable the Bundle, test out this configuration in your `config.yml` and start creating templates.

```
pimcore_rad_brick:
  areabricks:
    my_wysiwyg:
      label: WYSIWYG // Label to use in admin UI
      icon:  ~ // Path to icon in admin UI
      open: ~ // Set the open html
      close: ~ // Set the close html
      use_edit: false // Use edit.html.twig
      class: ~ // Use an existing symfony service
      editables:
        wysiwyg_content:
          type: wysiwyg
          options: [] // you can pass here any options accepted by the editable
```

Now create a template as usual in `views/Areas/my_wysiwyg/view.html.twig`:

```
{# add autogenerated meta description #}
{% do pimcore_head_meta().setDescription(wysiwyg_content.getData(), 160) %}

  {% pimcoreglossary %}
    {{ wysiwyg_content|raw }}
  {% endpimcoreglossary %}

```

### Creating multiple instances

[](#creating-multiple-instances)

In order to create multiple instances of an editable with the same configuraiton, it is as easy as adding the `instances` attribute:

`config.yml`

```
pimcore_rad_brick:
  areabricks:
    my_wysiwyg:
      label: WYSIWYG
      editables:
        wysiwyg_content:
          instances: 3
          type: wysiwyg
          options: [] // you can pass here any options accepted by the editable
```

The instance variables are created using the basename of the editable and postfixing it with either the provided ids in `instance_ids` or by simply using the array index.

```
{% for wysiwyg_instance in wysiwyg_content %}
  {{ wysiwyg_instance|raw }}
{% endfor %}
```

#### Making instances configurable

[](#making-instances-configurable)

In most cases, it doesn't make much sense to hardcode the number of instances of an editable. In order to make the number of instances configurable via admin we will leverage the power of the [Expression Language Component](https://symfony.com/doc/current/components/expression_language.html).

```
pimcore_rad_brick:
  areabricks:
    my_wysiwyg:
      label: WYSIWYG
      use_edit: true // Note that we use an edit template to configure the instances
      editables:
        num_editors:
          type: select
          options:
            store: [1,2,5]
        wysiwyg_content:
          instances: view.get("num_editors").getData()
          type: wysiwyg
```

NOTE: The expression context contains the following objects:

- `request`: The current `Request` object
- `view`: The current `ViewModel`
- `datasources`: The `DatasourceRegistry`

#### Practical example

[](#practical-example)

A more practical example is an integration into the bootstrap grid. Two areabricks can be easily created in order to support the bootstrap grid.

```
pimcore_rad_brick:
  areabricks:
    container:
      label: Container
      use_edit: true
      editables:
        container_css_class:
          type: input
        container_area_block:
          type: areablock
          options:
            allowed:
            - columns
            params:
              forceEditInView: true
    columns:
      label: Columns
      use_edit: true
      editables:
        num_columns:
          type: select
          options:
            store: [1, 2, 3, 4, 5, 6]
            defaultValue: 1
        column_area_block:
          instances: view.get("num_columns").getData()
          type: areablock
          options:
            params:
              forceEditInView: true
```

`container/view.html.twig`:

```

  {{ container_area_block|raw }}

```

`columns/edit.html.twig`:

```
# of Columns: {{ num_columns|raw }}
```

`columns/view.html.twig`:

```
{% set col_width = 12 / num_columns.getData() %}

  {% for column in column_area_block) %}

      {{ column|raw }}

  {% else %}

      {{ column_area_block|raw }}

  {% endfor %}

```

### Using groups

[](#using-groups)

You might have noticed the strange `else` case in the above example. This is due to how the `instances` work. If only one instance is configured, then the variable is presented in the view as an editable, not an array.

In order to keep instances in an array or group, you can use the `groups`and `group` configurations to provide templates to editables.

`config.yml`:

```
areabricks:
  promo_box:
    label: Promo Box
    use_edit: true
    groups:
      boxes:
        instances: 'view["num_boxes"].getValue() ? : 2'
    editables:
      num_boxes:
        type: select
        options:
          store: [2, 3, 5]
      link:
        type: link
        group: boxes
      image:
        type: image
        group: boxes
```

`promo_box/edit.html.twig`:

```
# of Boxes: {{ num_boxes|raw }}
```

`view.html.twig`:

```

{% for box in boxes %}
  {{ box.link|raw }}
  {{ box.image|raw }}
{% endfor %}

```

### Using maps

[](#using-maps)

At times an editable in your areabrick depends on some configuration value. The `map` configuration node may be used to map data between editables.

For example an image areabrick may be configured to use a specific thumbnail:

`edit.html.twig`

```
Thumbnail: {{ image_thumbnail|raw }}
```

`view.html.twig`

```

{{ image_content|raw }}

```

`config.yml`

```
pimcore_rad_brick:
  areabricks:
    image:
      label: Image
      editables:
        image_thumbnail:
          type: input
        image_content:
          type: image
          map:
          - source: '[image_thumbnail].data'
            target: '[options][thumbnail]'
```

The `source` and `target` properties uses the [Symfony Property Access Component](https://symfony.com/doc/current/components/property_access.html) to fetch and insert data.

The above mapping example would fetch the `data` property's value from `image_thumbnail` editable (resides in ViewModel, hence the array notation) and insert right into the config tree in `[pimcore_rad_brick][areabricks][image][editables][image_content][options][thumbnail]`

### Using Datasources

[](#using-datasources)

Datasources simplify the creation of widgets that get their data from other services. For example, in CoreShop one might want to show a slider that contains the products of a certain category.

`config.yml`

```
pimcore_rad_brick:
  ## Define data sources to be used by areabricks
  datasources:
    products_by_category:
      service_id: 'app.repository.product'
      method: 'findByCategory'
      args:
      - '[category]' ## Specify which data to pass. The input array is passed by areabricks.
  areabricks:
    category_slider:
      label: Category Slider
      editables:
        select_category:
          type: relation
          options:
            types: ['object']
            subtypes:
              object: ['object']
            classes: ['CoreShopCategory']

      datasources: ## Datasource configuration for this areabrick
        products:
          id: products_by_category
          args:
            category: 'view["category"].getElement()' ## Define category argument (available in input array to the datasource above)
```

The property path of an input argument for a datasource contains following information:

- `request`: Access to the current request object
- `view`: Access to elements in the viewmodel

`edit.html.twig`

```
Category: {{ select_category|raw }}
```

`view.html.twig`

```

  {% for product in products %}
  {% include 'product-tile.tml.twig' with {product: product} only %}

```

#### Connecting Editables and datasources

[](#connecting-editables-and-datasources)

When using datasources, it is also possible to connect editables to items in datasources. For example product teasers could have a tagline which needs to be added manually, but all other fields are filled by the product. The following configuration can solve this issue:

```
pimcore_rad_brick:
  datasources:
    products_by_category:
      service_id: 'app.repository.product'
      method: 'findByCategory'
      args:
      - '[category]' ## Specify which data to pass. The input array is passed by areabricks.
  areabricks:
    category_slider:
      label: Category Slider
      use_edit: true
      editables:
        select_category:
          type: relation
          options:
            types: ['object']
            subtypes:
              object: ['object']
            classes: ['CoreShopCategory']
        product_title:
          type: input
          datasource:
            name: products
            id: item.getId() # Specify ID source (will be casted to string)

      datasources:
        products:
          id: products_by_category
          args:
            category: view["select_category"].getElement()
```

Contribute
----------

[](#contribute)

If you find something that is missing which there is no issue for or want to help fix a bug or documentation, please feel free to submit a PR. Read through the code and try to run the tests with `vendor/bin/phpunit`Coding standard is `@PSR2` and `php-cs-fixer` will be used to format the code. Scrutinizer will be used in future for enforcing coding standards.

Donations
---------

[](#donations)

[![Buy Me A Coffee](https://camo.githubusercontent.com/fd2d9d38ab697cd803640756e75472ef491beb76089b13ef1dd26fa8d11df794/68747470733a2f2f63646e2e6275796d6561636f666665652e636f6d2f627574746f6e732f617269616c2d77686974652e706e67)](https://www.buymeacoffee.com/5sAwkYgyb)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2158d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7e6b0feca8c2891e1d8ab36bbb00836140a95d59a2648fa086d0b01dee42632d?d=identicon)[khusseini](/maintainers/khusseini)

---

Top Contributors

[![khusseini](https://avatars.githubusercontent.com/u/1408107?v=4)](https://github.com/khusseini "khusseini (59 commits)")

---

Tags

pimcore-bundlepimcore5

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/khusseini-pimcore-radbrick/health.svg)

```
[![Health](https://phpackages.com/badges/khusseini-pimcore-radbrick/health.svg)](https://phpackages.com/packages/khusseini-pimcore-radbrick)
```

###  Alternatives

[froala/wysiwyg-editor

A beautiful jQuery WYSIWYG HTML rich text editor. High performance and modern design make it easy to use for developers and loved by users.

5.4k306.9k3](/packages/froala-wysiwyg-editor)[rewieer/taskschedulerbundle

Task Scheduler with CRON for Symfony

63242.1k](/packages/rewieer-taskschedulerbundle)[ghoster/module-outofstockatlast

Magento 2.4.x module Sort Out Of Stock Product At last the product list

60122.6k](/packages/ghoster-module-outofstockatlast)[fof/byobu

Well integrated, advanced private discussions.

61105.8k9](/packages/fof-byobu)[flowpack/listable

Tiny extension for listing things

35209.0k7](/packages/flowpack-listable)[snowdog/module-alpaca-components

Components of the Alpaca theme for Magento 2

4582.2k2](/packages/snowdog-module-alpaca-components)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
