Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Sonata Laravel Package

ekino/sonata

View on GitHub
Deep Wiki
Context7

Block selection dialog with categories

select-a-block.png

Configuration

To enable and configure this dialog (replacing the default dropdown and button) you have to configure it according to the following example:

sonata_helpers:
  compose_container:
    enabled: true
    categories:
      '':  "block.category.default"
      foo: "Foo"
      bar: "Bar"
    block_config:
      'App\Block\BannerBlockService':
        categories:
          - foo
      'App\Block\SimpleTextBlockService':
        only_pages:
          - home
        categories:
          - bar
      'App\Block\SkillsBlockService':
        categories:
          - foo
          - bar
  • enabled: Set to false to completely disable the feature. (Or do not add this configuration at all.)
  • categories: Key-label-list of all available categories. The empty key is the default category, assigned to all blocks without specified categories.
  • block_config: Assign one or more categories to each Block class.
  • categories: List of all categories (keys) in which the block should appear.
  • only_pages: Can be added to restrict a block to certain routes.

Important: If this features is enabled, the PageAdminController will be replaced by this bundle's version to override composeContainerShowAction(). If you need to extend it, please extend Sonata\HelpersBundle\Controller\PageAdminController.

Installation

This feature requires jQuery 2 or 3.

You need to make the following files available to the web frontend:

  • src/Resources/public/js/MutationObserver.js
  • src/Resources/public/css/blockSelectModal.scss

If for example you use Webpack-Encore, edit your webpack.config.js:

Encore.addStyleEntry('...', [
  ...
  path.resolve('/vendor/ekino/sonata/src/Resources/public/css/blockSelectModal.scss')
]);
...
Encore.addEntry('...', [
  ...
  path.resolve('/vendor/ekino/sonata/src/Resources/public/js/MutationObserver.js')
]);
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui