0

With the default admin classes for the BlockBundle (1.0.*) in Symfony CMF, I am unable to modify the "parent" of a block.

The parent filed is disabled (both when adding and editing), but always shows "/cms/content".

I would like to just use the admin classes and be able to set the parent of a block (particularly to setup some container blocks with content).

Why is it disabled? Do I need some common root for blocks to get it to work? If I tried to create my own admin class, I'm not sure what to do because the admin class does add the "parent" field the same way I would.

Matt
  • 5,478
  • 9
  • 56
  • 95

2 Answers2

0

I suspect you have a javascript issue with your installation. Did the installation finish successfully, and are you accessing the site through app_dev.php or did run all the composer commands listed in the setup?

You should have a tree of documents above that field with the path. Have a look at the sandbox demo install:

http://cmf.liip.ch/en/admin/cmf/block/simpleblock/cms/content/home/additionalInfoBlock/child1/edit

dbu
  • 1,497
  • 9
  • 8
  • No, javascript seems to be loading fine. When I add/edit a block, I see the "loading..." thing and then it disappears. When I add/edit a page, I get the tree view and can select the parent properly. I will compare my config with the sandbox to see if I'm doing something wrong for the blocks. – Matt Feb 18 '14 at 07:44
0

I was missing the proper Sonata admin configuration to allow this. Thanks dbu for pointing out that it works in the sandbox.

sonata_doctrine_phpcr_admin:
    document_tree:
        ...
        Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\ReferenceBlock:
            valid_children: []
        Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\ActionBlock:
            valid_children: []
        Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\SimpleBlock:
            valid_children: []
        Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\SlideshowBlock:
            valid_children:
                - Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\ImagineBlock
        Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\ImagineBlock:
            valid_children: []
        Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\RssBlock:
            valid_children: []
        Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\ContainerBlock:
            valid_children:
                - Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\SimpleBlock
                - Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\ContainerBlock
                - Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\ReferenceBlock
                - Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\ActionBlock
                - Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\SlideshowBlock
                - Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\RssBlock
        ...
Matt
  • 5,478
  • 9
  • 56
  • 95