{"id":22920721,"url":"https://github.com/teamneusta/pimcore-areabrick-config-bundle","last_synced_at":"2026-06-02T11:00:49.016Z","repository":{"id":65394490,"uuid":"591590703","full_name":"teamneusta/pimcore-areabrick-config-bundle","owner":"teamneusta","description":"Object-oriented editable dialog box configuration building for areabricks","archived":false,"fork":false,"pushed_at":"2026-04-20T10:16:59.000Z","size":213,"stargazers_count":3,"open_issues_count":4,"forks_count":0,"subscribers_count":9,"default_branch":"main","last_synced_at":"2026-04-20T11:39:22.336Z","etag":null,"topics":["php","pimcore","pimcore-bundle"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/teamneusta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-01-21T07:39:44.000Z","updated_at":"2026-04-20T10:17:03.000Z","dependencies_parsed_at":"2024-12-14T07:16:52.048Z","dependency_job_id":"e0d0345a-bf2f-4947-a91a-655a9ec33364","html_url":"https://github.com/teamneusta/pimcore-areabrick-config-bundle","commit_stats":{"total_commits":43,"total_committers":4,"mean_commits":10.75,"dds":0.5116279069767442,"last_synced_commit":"5113420a3dd86c25d55938249b57265d86083dc2"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/teamneusta/pimcore-areabrick-config-bundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teamneusta%2Fpimcore-areabrick-config-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teamneusta%2Fpimcore-areabrick-config-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teamneusta%2Fpimcore-areabrick-config-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teamneusta%2Fpimcore-areabrick-config-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teamneusta","download_url":"https://codeload.github.com/teamneusta/pimcore-areabrick-config-bundle/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teamneusta%2Fpimcore-areabrick-config-bundle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33818568,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-02T02:00:07.132Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","pimcore","pimcore-bundle"],"created_at":"2024-12-14T07:16:45.953Z","updated_at":"2026-06-02T11:00:48.961Z","avatar_url":"https://github.com/teamneusta.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Areabrick Config Bundle\n\nObject-oriented editable dialog box configuration building for Areabricks.\n\n## Installation\n\n1. **Require the bundle**\n\n   ```shell\n   composer require teamneusta/pimcore-areabrick-config-bundle\n   ```\n\n2. **Enable the bundle**\n\n   Add the Bundle to your `config/bundles.php`:\n\n   ```php\n   Neusta\\Pimcore\\AreabrickConfigBundle\\NeustaPimcoreAreabrickConfigBundle::class =\u003e ['all' =\u003e true],\n   ```\n\n## Usage\n\nThis bundle allows you to create Areabrick configuration dialogs in an object-oriented way.\n\n### 1. Prepare Areabrick Class\n\nYour Areabrick class must implement the `Pimcore\\Extension\\Document\\Areabrick\\EditableDialogBoxInterface` interface \nand use the `Neusta\\Pimcore\\AreabrickConfigBundle\\HasDialogBox` trait.\n\nThen, implement the `buildDialogBox()` method to define the dialog.\n\n```php\n\u003c?php\n\nnamespace App\\Document\\Areabrick;\n\nuse Neusta\\Pimcore\\AreabrickConfigBundle\\DialogBoxBuilder;\nuse Neusta\\Pimcore\\AreabrickConfigBundle\\HasDialogBox;\nuse Pimcore\\Extension\\Document\\Areabrick\\AbstractTemplateAreabrick;\nuse Pimcore\\Extension\\Document\\Areabrick\\EditableDialogBoxInterface;\nuse Pimcore\\Model\\Document\\Editable;\nuse Pimcore\\Model\\Document\\Editable\\Area\\Info;\n\nclass MyAreabrick extends AbstractTemplateAreabrick implements EditableDialogBoxInterface\n{   \n    /** @template-use HasDialogBox\u003cDialogBoxBuilder\u003e */\n    use HasDialogBox;\n\n    private function buildDialogBox(DialogBoxBuilder $dialogBox, Editable $area, ?Info $info): void\n    {\n        $dialogBox\n            -\u003eaddNamedTab('settings', 'Settings',\n                $dialogBox-\u003ecreateInput('my-input')\n                    -\u003esetLabel('Text Input')\n                    -\u003esetPlaceholder('Please enter text...')\n            )\n            -\u003eaddNamedTab('options', 'Options',\n                $dialogBox-\u003ecreateCheckbox('my-checkbox')\n                    -\u003esetLabel('Activate')\n                    -\u003esetDefaultChecked()\n            );\n    }\n}\n```\n\n### 2. Access in Twig Template\n\nThe configured values can be retrieved via the Pimcore editables in the template as usual:\n\n```twig\n\u003cp\u003eInput: {{ pimcore_input('my-input').getData() }}\u003c/p\u003e\n\n{% if pimcore_checkbox('my-checkbox').isChecked() %}\n    \u003cp\u003eCheckbox is activated!\u003c/p\u003e\n{% endif %}\n```\n\n## Features\n\n### Dialog Configuration\n\nYou can customize the size of the dialog and specify whether the page should be reloaded after closing.\n\n```php\n$dialogBox\n    -\u003ewidth(800)\n    -\u003eheight(600)\n    -\u003ereloadOnClose(true);\n```\n\n### Layout Options\n\n#### Simple Content\n\nFor simple dialogs you can use `addContent`:\n\n```php\n$dialogBox-\u003eaddContent(\n    $dialogBox-\u003ecreateInput('field-1'),\n    $dialogBox-\u003ecreateInput('field-2')\n);\n```\n\n#### Tabs\n\nIf you want to organize your fields into multiple tabs, use `addTab`:\n\n```php\n$dialogBox-\u003eaddTab('tab_name', 'Tab Title', \n    $dialogBox-\u003ecreateInput('field-1'),\n    $dialogBox-\u003ecreateInput('field-2')\n);\n```\n\n\u003e [!IMPORTANT]\n\u003e You cannot mix `addTab` and `addContent` in the same dialog.\n\n### Available Editables\n\nThe `DialogBoxBuilder` provides various methods for creating editables:\n\n#### Input\n\nA simple text input field.\n\n```php\n$dialogBox-\u003ecreateInput('name')\n    -\u003esetLabel('Label')\n    -\u003esetPlaceholder('Placeholder')\n    -\u003esetDefaultValue('Default value')\n    -\u003esetWidth(300);\n```\n\n#### Checkbox\n\nA simple checkbox to toggle a boolean value.\n\n```php\n$dialogBox-\u003ecreateCheckbox('name')\n    -\u003esetLabel('Label')\n    -\u003esetDefaultChecked(); // or setDefaultUnchecked()\n```\n\n#### Select\n\nA dropdown selection field.\n\n```php\n$dialogBox-\u003ecreateSelect('name', [\n    'value1' =\u003e 'Label 1',\n    'value2' =\u003e 'Label 2',\n])\n    -\u003esetLabel('Selection')\n    -\u003esetDefaultValue('value2');\n```\n\n#### Relation\n\nAllows the selection of objects, assets, or documents.\n\n```php\n$dialogBox-\u003ecreateRelation('my-relation')\n    -\u003esetLabel('Relation')\n    -\u003eallowObjectsOfClass('MyPimcoreClass')\n    -\u003eallowAssetsOfType('image')\n    -\u003eallowDocumentsOfType('page');\n```\n\n#### Link\n\nA field for selecting internal or external links.\n\n```php\n$dialogBox-\u003ecreateLink('my-link')\n    -\u003esetLabel('Link')\n    -\u003eallowTypes('document', 'asset', 'object')\n    -\u003edisallowFields('anchor', 'rel');\n```\n\n#### Numeric\n\nAn input field for numbers with min/max validation.\n\n```php\n$dialogBox-\u003ecreateNumeric('count', 1, 10)\n    -\u003esetLabel('Count')\n    -\u003esetDefaultValue(5);\n```\n\n#### Date\n\nA date picker.\n\n```php\n$dialogBox-\u003ecreateDate('date')\n    -\u003esetLabel('Date')\n    -\u003esetFormat('d.m.Y');\n```\n\n#### Custom Configuration\n\nAll editables allow setting arbitrary configuration values via the `addConfig` method. \nThis is useful for passing additional parameters that are not covered by the dedicated methods:\n\n```php\n$dialogBox-\u003ecreateInput('name')\n    -\u003eaddConfig('any-editable-config-key', 'value');\n```\n\n## DialogBoxConfigurator\n\nThe `DialogBoxConfigurator` allows you to customize the dialog box configuration dynamically.\nThis is particularly useful if an Areabrick is used within another Areabrick\nand you want to adjust settings like default values or select options based on the context.\n\n### 1. Create a Configurator Class\n\nImplement the `Neusta\\Pimcore\\AreabrickConfigBundle\\DialogBoxConfigurator` interface:\n\n```php\n\u003c?php\n\nnamespace App\\Areabrick;\n\nuse Neusta\\Pimcore\\AreabrickConfigBundle\\DialogBoxBuilder;\nuse Neusta\\Pimcore\\AreabrickConfigBundle\\DialogBoxConfigurator;\nuse Pimcore\\Model\\Document\\Editable;\nuse Pimcore\\Model\\Document\\Editable\\Area\\Info;\n\nfinal class MyAreabrickDialogBoxConfigurator implements DialogBoxConfigurator\n{\n    public function configureDialogBox(DialogBoxBuilder $dialogBox, Editable $area, ?Info $info): void\n    {\n        $dialogBox-\u003eheight(500);\n\n        $dialogBox-\u003egetTab('Settings')\n            -\u003egetEditable('my-input')\n                -\u003esetDefaultValue('Custom Context Value');\n\n        $dialogBox-\u003ereloadOnClose(false);\n    }\n}\n```\n\n\u003e [!IMPORTANT]\n\u003e The configurator class must be registered as a `public` service in your container.\n\n### 2. Usage in Twig\n\nYou can pass the service ID of your configurator via the `dialogBoxConfigurator` parameter\nin the `pimcore_area` or `pimcore_areablock` helpers.\n\n\u003e [!TIP]\n\u003e If the service ID matches the FQCN, you can simply use the FQCN.\n\n```twig\n{{ pimcore_area('myfield', {\n    type: 'my-areabrick',\n    params: {\n        'my-areabrick': {\n            dialogBoxConfigurator: 'App\\Areabrick\\MyAreabrickDialogBoxConfigurator',\n        }\n    },\n}) }}\n```\n\n## Configuration\n\nCurrently, there is no configuration available.\n\n## Contribution\n\nFeel free to open issues for any bug, feature request, or other ideas.\n\n\u003e [!NOTE]\n\u003e This bundle does not yet cover all of Pimcore’s possibilities and will be expanded as needed.\n\u003e Pull Requests are welcome!\n\nPlease remember to create an issue before creating large pull requests.\n\n### Local Development\n\nTo develop on your local machine, instance identification for Pimcore 12 is needed.\n\nCopy the `compose.override.yaml.dist` file to `compose.override.yaml`:\n\n```shell\ncp -n compose.override.yaml.dist compose.override.yaml\n```\n\nAnd replace all `replace_with_secret` values with your data.\n\nThen install the dependencies:\n\n```shell\nbin/composer install\n```\n\nWe use composer scripts for our main quality tools. They can be executed via the `bin/composer` file as well.\n\n```shell\nbin/composer cs:fix\nbin/composer phpstan\n```\n\nFor the tests there is a different script that includes a database setup.\n\n```shell\nbin/run-tests\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteamneusta%2Fpimcore-areabrick-config-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteamneusta%2Fpimcore-areabrick-config-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteamneusta%2Fpimcore-areabrick-config-bundle/lists"}