3

What does the context means inside the configurations of the Sonata Block Bundle? What is for?

sonata_block:
    default_contexts: [cms]
    blocks:
        sonata.admin.block.admin_list:
            contexts:   [admin]
Guillermo Gutiérrez
  • 17,273
  • 17
  • 89
  • 116
  • 6
    I wish there was more documentation on the main site.... tststs, such a powerfull API and so little info – androidu May 15 '14 at 11:34

1 Answers1

7

Sorry for the delay, a context is used to group a set of blocks. So you can have block related to a CMS context, or to the admin.

So an admin block will be never used in the CMS context.

rande
  • 656
  • 4
  • 5
  • You really wanted the Necromancer badge, hehehe... (just kidding). Thank you :) Just some doubts: you have only those two contexts, or there are more? Can I define custom contexts? – Guillermo Gutiérrez Jul 18 '14 at 13:51
  • 3
    Just started to reply to question on stackoverflow ... You can have your own context, just use one in the configuration. The cms which as been renamed to sonata_page_bundle is used in the PageBundle. But you can create your own PageBundle like with your own context. – rande Jul 21 '14 at 23:21