Shopware 6 override twig block 插件

问题描述 投票:0回答:0

我安装了一些插件。我想覆盖文件vendor/store.shopware.com/netinextstorelocator/src/Resources/views/storefront/store_locator/detail.twig

{% sw_extends '@Storefront/storefront/base.html.twig' %}

{% block base_content %}
    {% block neti_store_locator_detail %}
        <div class="neti-next-store-locator-detail">
        {% block neti_store_locator_detail_config %}
            <input type="hidden" value="{{ page.config|json_encode|escape }}" ref="config">
            <input type="hidden" value="{{ page.store|json_encode|escape }}" ref="store">
        {% endblock %}
        ...

所以我通过命令创建插件bin/console plugin:create SwagStoreLocator并创建文件custom/plugins/SwagStoreLocator/src/Resources/views/storefront/store_locator/detail.twig

{% sw_extends '@Storefront/storefront/base.html.twig' %}

{% block neti_store_locator_detail_config %}
    <div>Not working :(</div>
{% endblock %}

然后我在管理面板中安装并打开了插件。我输入了 bin/console cache:clearbin/console theme:compile。不幸的是,没有错误,没有覆盖……我怎样才能从插件中只编辑树枝。我不想在供应商文件夹中进行,因为不允许提交此类文件夹。

plugins twig overriding shopware
© www.soinside.com 2019 - 2024. All rights reserved.