0

I want to create a custom PHPCR document for a set of pages that I have in my website. I extended the SimpleCms/Page class and I created my object and persisted it using the document manager. I can see the content using node:dump command and in the database But I can't see it in the treebrowser.

So I want to know what are the other things I should provide to let the treebrowser display my custom branch.

MKoosej
  • 3,405
  • 3
  • 21
  • 29

1 Answers1

2

You need to declare that your document may show up in the tree.

document_tree:
    Acme\DemoBundle\Document\YourPage:
        valid_children:
            - Symfony\Cmf\Bundle\SimpleCmsBundle\Doctrine\Phpcr\Page
    Symfony\Cmf\Bundle\SimpleCmsBundle\Doctrine\Phpcr\Page:
        valid_children:
            - Acme\DemoBundle\Document\YourPage

More information is in the sonata doc.

dbu
  • 1,497
  • 9
  • 8
  • Thanks dbu. I can see my node now but it's not editable. So I guess the next step is creating the admin class for my Document type. Does creating admin classes give me the option to create content in the right click menu? – MKoosej May 09 '14 at 13:52
  • I got that working and my item showed up in the context menu. Thanks for the help. – MKoosej May 09 '14 at 20:48
  • Glad i could help. And just to confirm: Yes you need an admin class for each content document class that you want to create with right click. Otherwise sonata does not provide a URL to add documents of this class. – dbu May 10 '14 at 11:24