How to change the “sonata project” link in SonataAdmin?

偶尔善良 提交于 2019-12-07 17:05:59

问题


I have a problem with SonataAdminBundle, I don't find how to change the "sonata project" link in the left board.

I have "My title" + one image and under there is "sonata project".

How can I change this ?


回答1:


In order to customize the content of the block under Sonata Admin (by default it's a link with text sonata project), you have to modify your app/config/config.yml file by adding this:

sonata_admin:
    # ...
    templates:
        # Override default template
        layout: AcmeAdminBundle::standard_layout.html.twig

Then create the standard_layout.html.twig file in the src/Acme/AdminBundle/Resources/views directory:

{# src/Acme/AdminBundle/Resources/views/standard_layout.html.twig #}
{% extends 'SonataAdminBundle::standard_layout.html.twig' %}

{% block side_bar_after_nav %}
    <p class="text-center"><a href="{{ path('your_route') }}">Route name</a></p>
{% endblock %}

This will replace the default content of this block.


If you don't want to place the file in a bundle, use this path in app/config/config.yml : layout: "::standard_layout.html.twig" ant put the file in app/Resources/views.


And if you want to change the title Sonata Admin, add this to your app/config/config.yml file:

sonata_admin:
    # ...
    title: My Name


来源:https://stackoverflow.com/questions/29827713/how-to-change-the-sonata-project-link-in-sonataadmin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!