Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the "sonata project" link in SonataAdmin?

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 ?

like image 446
cyber_truite Avatar asked Dec 07 '25 09:12

cyber_truite


1 Answers

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
like image 107
A.L Avatar answered Dec 10 '25 00:12

A.L



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!