如何更改“奏鸣曲项目"SonataAdmin 中的链接? [英] How to change the "sonata project" link in SonataAdmin?

查看:39
本文介绍了如何更改“奏鸣曲项目"SonataAdmin 中的链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 SonataAdminBundle 时遇到问题,我没有找到如何更改左侧面板中的奏鸣曲项目"链接.

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".

我该如何更改?

推荐答案

为了自定义 Sonata Admin 下的块的内容(默认是带有文本的链接sonata project),您必须通过添加以下内容来修改您的 app/config/config.yml 文件:

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

然后在src/Acme/AdminBundle/Resources/views目录下创建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 %}

这将替换 defaultlow rel="nofr">此块的内容.

如果您不想将文件放在一个包中,请在 app/config/config.yml 中使用此路径: layout: "::standard_layout.html.twig" ant 把文件放在 app/Resources/views 中.

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.

如果您想更改标题 Sonata Admin,请将其添加到您的 app/config/config.yml 文件中:

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

sonata_admin:
    # ...
    title: My Name

这篇关于如何更改“奏鸣曲项目"SonataAdmin 中的链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆