问题
I have installed SonataMediaBundle and SonataClassification Bundle with SonataAdminBundle
Media Library and Classification Library tables appear automatically in admin dashboard.
However, I would like to remove this two panes.
Now, I have found these settings are written in vendor/sonata-project/classification-bundle/Resources/config/admin.xml
I guess this file is related though, this is in vendor directory.
I have my original bundle ApplicationSonataClassificationBundle
to override SonataClassificationBundle
I can override files in controller, however in Resources/config directory??
How can I override this file and remove from dashboard??
<?xml version="1.0" encoding="UTF-8"?>
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="sonata.classification.admin.category" class="%sonata.classification.admin.category.class%">
<tag name="sonata.admin" manager_type="orm" group="sonata_classification" label="label_categories" label_catalogue="%sonata.classification.admin.category.translation_domain%" label_translator_strategy="sonata.admin.label.strategy.underscore"/>
<argument/>
<argument>%sonata.classification.admin.category.entity%</argument>
<argument>%sonata.classification.admin.category.controller%</argument>
<argument type="service" id="sonata.classification.manager.context"/>
<call method="setTranslationDomain">
<argument>%sonata.classification.admin.category.translation_domain%</argument>
</call>
<call method="setTemplates">
<argument type="collection">
<argument key="list">SonataClassificationBundle:CategoryAdmin:list.html.twig</argument>
<argument key="tree">SonataClassificationBundle:CategoryAdmin:tree.html.twig</argument>
</argument>
</call>
</service>
<service id="sonata.classification.admin.tag" class="%sonata.classification.admin.tag.class%">
<tag name="sonata.admin" manager_type="orm" group="sonata_classification" label="label_tags" label_catalogue="%sonata.classification.admin.tag.translation_domain%" label_translator_strategy="sonata.admin.label.strategy.underscore"/>
<argument/>
<argument>%sonata.classification.admin.tag.entity%</argument>
<argument>%sonata.classification.admin.tag.controller%</argument>
<argument type="service" id="sonata.classification.manager.context"/>
<call method="setTranslationDomain">
<argument>%sonata.classification.admin.tag.translation_domain%</argument>
</call>
</service>
<service id="sonata.classification.admin.collection" class="%sonata.classification.admin.collection.class%">
<tag name="sonata.admin" manager_type="orm" group="sonata_classification" label="label_collections" label_catalogue="%sonata.classification.admin.collection.translation_domain%" label_translator_strategy="sonata.admin.label.strategy.underscore"/>
<argument/>
<argument>%sonata.classification.admin.collection.entity%</argument>
<argument>%sonata.classification.admin.collection.controller%</argument>
<argument type="service" id="sonata.classification.manager.context"/>
<call method="setTranslationDomain">
<argument>%sonata.classification.admin.collection.translation_domain%</argument>
</call>
</service>
<service id="sonata.classification.admin.context" class="%sonata.classification.admin.context.class%">
<tag name="sonata.admin" manager_type="orm" group="sonata_classification" label="label_contexts" label_catalogue="%sonata.classification.admin.context.translation_domain%" label_translator_strategy="sonata.admin.label.strategy.underscore"/>
<argument/>
<argument>%sonata.classification.admin.context.entity%</argument>
<argument>%sonata.classification.admin.context.controller%</argument>
<call method="setTranslationDomain">
<argument>%sonata.classification.admin.context.translation_domain%</argument>
</call>
</service>
</services>
</container>
来源:https://stackoverflow.com/questions/42017286/how-to-override-xml-under-config-directory-to-hide-sonatamediabundle-and-classif