如何修改{{block(' form_widget')}}

时间:2017-03-13 12:26:51

标签: php symfony media sonata-media-bundle

我想通过SonataMediaBundle编辑媒体形式

这里' widget_label_binary_content' widget_label_unlink。

enter image description here

我发现这个表单是通过Resources / Form / media_Widgets.html.twig

创建的

所以,我压倒了这根树枝。

Application/MediaBundle/Resources/views/Form/Media_widgets.html.twig

并发现{{block(' form_widget')}}呈现此表单。

但我不知道在哪里可以修改{{block(' form_widget')}}的内部。

{% block sonata_media_type_widget %}
    <div class="row">
        <div class="col-md-4 pull-left">
            {% if value is not empty and value.providerReference %}
                {% if sonata_admin_enabled is defined and sonata_admin_enabled %}
                    <a href="{{ sonata_admin.admin.getConfigurationPool().adminByAdminCode('sonata.media.admin.media').generateObjectUrl('edit', value) }}">
                        <strong>{{ value.name }}</strong>
                    </a>
                {% else %}
                    <strong>{{ value.name  }}</strong>
                {% endif %}
            {% else %}
                <strong>{{ 'no_linked_media'|trans({}, 'SonataMediaBundle') }}</strong>
            {% endif %}
        </div>

       <!--  <div class="col-md-3 pull-left"><strong>{{ 'widget_headline_information'|trans({}, 'SonataMediaBundle') }}</strong></div> -->
       <!--   <div class="col-md-2 pull-left"><strong>{{ 'link_media'|trans({}, 'SonataMediaBundle') }}</strong></div>-->
    </div>
    <div class="row">
        <div class="col-md-4 pull-left">
            {% if value is not empty and value.providerReference %}
                <div class="pull-left" style="margin-right: 5px">
                    {% thumbnail value, 'admin' with {'class': 'img-polaroid media-object'} %}
                </div>
            {% else %}
                <div class="pull-left" style="margin-right: 5px">
                    <img src="{{ asset('bundles/sonatamedia/grey.png') }}" class="img-polaroid media-object" style="width: 85px; height: 85px"/>
                </div>
            {% endif %}
        </div>
        <div class="col-md-3 pull-left">
        <!--
            {% if value is not empty and value.providerReference %}
                <strong>{{ 'widget_label_type'|trans({}, 'SonataMediaBundle') }}:</strong> <span type="label">{{ value.providerName|trans({}, 'SonataMediaBundle') }}</span>
                <br />
                <strong>{{ 'widget_label_context'|trans({}, 'SonataMediaBundle') }}:</strong> <span type="label">{{ value.context|trans({}, 'SonataMediaBundle') }}</span>
            {% else %}
                <strong>{{ 'widget_label_type'|trans({}, 'SonataMediaBundle') }}:</strong> <span type="label">{{ form.vars['provider']|trans({}, 'SonataMediaBundle') }}</span>
                <br />
                <strong>{{ 'widget_label_context'|trans({}, 'SonataMediaBundle') }}:</strong> <span type="label">{{ form.vars['context']|trans({}, 'SonataMediaBundle') }}</span>
            {% endif %}
            -->
        </div>
        <div class="col-md-2 pull-left">
            {{ block('form_widget') }}
        </div>
    </div>
{% endblock sonata_media_type_widget %}

0 个答案:

没有答案