Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Symfony CMF StaticContent show all child blocks in PHPCTRee? #97

Closed
gyalamanchi opened this issue Jan 15, 2014 · 4 comments
Closed

Symfony CMF StaticContent show all child blocks in PHPCTRee? #97

gyalamanchi opened this issue Jan 15, 2014 · 4 comments

Comments

@gyalamanchi
Copy link

Does anybody know how I can make all child blocks show up on the CMF Tree in the Sonata Admin for the StaticContent class? The way our system uses the Symfony\Cmf\Bundle\ContentBundle\Doctrine\Phpcr\StaticContent class is to just use it as a content document that we can attach other blocks to. I thought that was the purpose of the ContentBundle. Instead only blocks inside of this additionalInfoBlock container block appear in the tree. Unless I am doing something wrong.

I have looked at
Symfony/Cmf/Bundle/ContentBundle/Resources/config/doctrine-model/StaticContent.phpcr.xml:


There has to be way to get all the child blocks show. I just dont want to start hacking the PHPCRTree class to do this. Do I extend StaticContent and hopefully it will show all children? How do I go about this if that is the answer. Or is there another setting.

See this image below of what I can see in jackrabbitexplorer vs what is in the CMF Tree in the Sonata admin
screen shot 2014-01-15 at 1 49 30 pm

@wouterj
Copy link
Member

wouterj commented Jan 15, 2014

You have to look at your SonataDoctrinePhpcrAdmin configuration:

sonata_doctrine_phpcr_admin:
    document_tree:
        Doctrine\ODM\PHPCR\Document\Generic:
            valid_children:
                - all
        Symfony\Cmf\Bundle\ContentBundle\Doctrine\Phpcr\StaticContent:
            valid_children:
                - all
        # ...

This sets the valid_children for the StaticContent to all, meaning it'll show all children. You can also change this to only a specific block, or only blocks.

@gyalamanchi
Copy link
Author

I have tried it both ways -- no luck. It wont display those child blocks. It only displays blocks inside the additionalInfoBlock container block.

First I tried....

    Symfony\Cmf\Bundle\ContentBundle\Doctrine\Phpcr\StaticContent:
        valid_children:
            - Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\StringBlock
            - 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

Then I tried this too....

    Symfony\Cmf\Bundle\ContentBundle\Doctrine\Phpcr\StaticContent:
        valid_children:
            - all

I don't think this affects the display of the children in the actual visual tree itself.

You can see this is the situation even in the hosted demo @ http://cmf.liip.ch/en/admin/dashboard

It is the tree that wont show them -- those blocks are actually there when you query for them.

@wouterj
Copy link
Member

wouterj commented Jan 15, 2014

It is the tree that wont show them -- those blocks are actually there when you query for them.

And with the config, you configure the tree that shows them. But I know too less about the Sonata Admin integration to help you further, sorry.

@lsmith77
Copy link
Member

closing in favor of symfony-cmf/tree-browser-bundle#57

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants