Answer the question
In order to leave comments, you need to log in
Value of contexts key in SonataBlockBundle configuration?
SonataAdminBundle needs to sonata_block
be configured like this:
sonata_block:
default_contexts: [cms]
blocks:
sonata.admin.block.admin_list:
contexts: [admin]
cms
admin
sonata_page_bundle
Answer the question
In order to leave comments, you need to log in
Sonata works like this:
A route arrives, a CRUD controller is launched on the router, then the ExampleAdmin user service is called. The controller sends the data after the service to the view, and then the simplest magic.
foreach ($this->getBlocksByContext($context) as $block) {
$data[$block->getName()] = $block->render();
}
return $this->render($template, $data);
{% for item in items %}
{{ item | raw }}
{% endfor %}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question