April 2016
Intermediate to advanced
290 pages
5h 51m
English
In order to override a template that ships with a third-party bundle (such as SonataUserBundle), we have to create a duplicate of it in the app/Resources folder and modify it here.
To see how it works, let's start with the login page. At the moment, it looks ugly and empty and covered with some unnecessary elements.
Copy a few folders from sonata-project to your app/Resources folder as follows:
$ mkdir app/Resources/SonataUserBundle $ cp -r vendors/sonata-project/user-bundle/Resources/views/app/Resources/SonataUserBundle/
Now edit Security/base_login.html.twig as follows:
{# app/Resources/SonataUserBundle/views/Security/base_login.html.twig #} {% extends '::mavaBase.html.twig' %} {% block mavaBody %} {% block fos_user_content ...Read now
Unlock full access