Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #795 from sjopet/master

I added an entry to the configuration to be able to override the block_admin_list.html.twig template
  • Loading branch information...
commit 984df1a986500da230798627af65d1f31206ccbb 2 parents 779d6db + 898f4b3
@rande rande authored
View
2  Block/AdminListBlockService.php
@@ -57,7 +57,7 @@ public function execute(BlockInterface $block, Response $response = null)
}
}
- return $this->renderResponse('SonataAdminBundle:Block:block_admin_list.html.twig', array(
+ return $this->renderResponse($this->pool->getTemplate('list_block'), array(
'block' => $block,
'settings' => $settings,
'admin_pool' => $this->pool,
View
1  DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php
@@ -256,6 +256,7 @@ public function fixTemplates(ContainerBuilder $container, Definition $definition
'history' => 'SonataAdminBundle:CRUD:history.html.twig',
'history_revision' => 'SonataAdminBundle:CRUD:history_revision.html.twig',
'action' => 'SonataAdminBundle:CRUD:action.html.twig',
+ 'list_block' => 'SonataAdminBundle:Block:block_admin_list.html.twig',
), $definedTemplates);
$definition->addMethodCall('setTemplates', array($definedTemplates));
View
1  DependencyInjection/Configuration.php
@@ -135,6 +135,7 @@ public function getConfigTreeBuilder()
->scalarNode('history')->defaultValue('SonataAdminBundle:CRUD:history.html.twig')->cannotBeEmpty()->end()
->scalarNode('history_revision')->defaultValue('SonataAdminBundle:CRUD:history_revision.html.twig')->cannotBeEmpty()->end()
->scalarNode('action')->defaultValue('SonataAdminBundle:CRUD:action.html.twig')->cannotBeEmpty()->end()
+ ->scalarNode('list_block')->defaultValue('SonataAdminBundle:Block:block_admin_list.html.twig')->cannotBeEmpty()->end()
->end()
->end()
->end()
View
4 Resources/doc/reference/templates.rst
@@ -17,6 +17,9 @@ By default, an Admin class uses a set of templates, it is possible to tweak the
edit: SonataAdminBundle:CRUD:edit.html.twig
history: SonataAdminBundle:CRUD:history.html.twig
+ # default values of block templates, they should extend the base_block template
+ list_block: SonataAdminBundle:Block:block_admin_list.html.twig
+
Usage of each template :
@@ -27,6 +30,7 @@ Usage of each template :
* show : the template to use for the show action
* edit : the template to use for the edit and create action
* history : the template to use for the history / audit action
+* list_block : the template used for the list of admin blocks on the dashboard
The default values will be set only if the ``Admin::setTemplates`` is not called by the Container.
Please sign in to comment.
Something went wrong with that request. Please try again.