0

I try to create a new block from SonataBlockBundle, edit the content block and want to save it to database.

in my composer.json, i got:

    "sonata-project/admin-bundle": "^2.3.0",
    "sonata-project/doctrine-orm-admin-bundle": "^2.3.4",
    "sonata-project/media-bundle": "2.3.x-dev",
    "sonata-project/core-bundle": "^2.3.0",
    "sonata-project/intl-bundle": "^2.3.0",
    "doctrine/doctrine-migrations-bundle": "dev-master",
    "symfony-cmf/block-bundle": "^1.3.1",
    "jackalope/jackalope-doctrine-dbal": "1.2.*",
    "sonata-project/doctrine-phpcr-admin-bundle": "^1.2",
    "doctrine/doctrine-cache-bundle": "1.0.*"

In the dashboard, i got no menu to create a new block, and i got this error in the console:

The following document types provided in valid_children are invalid: Symfony\Cmf\Bundle\ContentBundle\Doctrine\Phpcr\StaticContent The class names provided could not be loaded

Can i use the symfony-cmf/block-bundle as a standalone without install all the symfony-cmf ?

How to simply create a SonataBlock, and save it to database ?

ibasaw
  • 493
  • 1
  • 7
  • 22

1 Answers1

0

I'm not sure if you can mix in symfony-cmf/block-bundle with SonataAdminBundle. But I can tell you, how to display Block's (SonataBlockBundle) on your dashboard.

  1. Include the SonataBlockBundle described in SonataBlockBundle's Installation Documentation.
  2. Refer to SonataAdminBundle's Dashboard Documentation to configure blocks on your dashboard.

In short it's pretty easy to configure more blocks (or even custom ones, just register them):

# app/config/config.yml
sonata_admin:
    dashboard:
        blocks:
            -
                position: top
                type:     sonata.block.service.text
                settings:
                    content: >
                        <p>My dashboard block</p>
                        <p>Feel free to extend me</p>
Michael Hirschler
  • 2,345
  • 16
  • 28