简体   繁体   English

在列表视图中自定义下载Sonata Admin

[英]Customize Download in the list view Sonata Admin

I want to remove csv, xml and json formats from Download. 我想从下载中删除csv,xml和json格式。 Where can i customize this page? 我在哪里可以自定义此页面?

在此处输入图片说明

All you have to do right now is override the getExportFormats method of your admin, so that it returns the list of formats that you really want. 现在,您要做的就是覆盖管理员的getExportFormats方法,以便它返回您真正想要的格式列表。

In the future, you will be able to configure that globally thanks to this contribution I made . 将来,由于我所做的贡献 ,您将能够在全局范围内进行配置。

If you also want to change the button to a link, you need to override the list template, and customize the table_footer block (the template to override is vendor/sonata-project/admin-bundle/Resources/views/CRUD/base_list.html.twig ), so just copy/paste and adapt the table_footer block. 如果您还想将按钮更改为链接,则需要覆盖列表模板,并自定义table_footer块(要覆盖的模板是vendor/sonata-project/admin-bundle/Resources/views/CRUD/base_list.html.twig ),因此只需复制/粘贴并修改table_footer块。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM