You can only override a single field template in the list view, for this
you should extend base_list_field, for example:
{% extends 'SonataAdminBundle:CRUD:base_list_field.html.twig' %}
{% block field %}
//...
{% endblock field %}
protected function configureListFields(ListMapper $listMapper)
{
$listMapper->add('thumb', null, array('template' =>
"MyAdminBundle:Midia:list_thumb.html.twig"));
}
Att.,
Cassiano Tartari
2016-11-18 8:58 GMT-02:00 stanislas brunet <[email protected]>:
> Excuse me, maybe this problem was a long ago but i have exactly the same,
> do you remember how you fixed it?
>
> my code :
> in app/Ressources/views/Admin/DisplayClient.html.twig
>
> {% extends 'SonataAdminBundle:CRUD:base_show_field.html.twig' %}
>
>
> {% block field %}
> <img src="{{ asset('uploads/media/') }}{{ value|nl2br }}"/>
> {% endblock %}
> Thanks in advance
>
> Le mercredi 27 mai 2015 17:38:19 UTC+2, Tanguy Bernard a écrit :
>>
>> Hello,
>> I am overriding my list of projects with sonata admin bundle and I have
>> this error :
>>
>> Variable "field_description" does not exist in
>> SonataAdminBundle:CRUD:base_list_field.html.twig at line 12
>> my code :
>>
>> {% extends 'SonataAdminBundle:CRUD:base_list_field.html.twig' %}
>>
>> {% block field %}
>> <div>
>> <strong>{{ object.name }}</strong> <br />
>> {{ object.providername}} : {{ object.width }}x{{ object.height }}
>> <br />
>> </div>
>> {% endblock %}
>>
>>
>>
>> When I use "base_list.html.twig" instead of base_list_field.html.twig
>> everything is fine but I can't change the field...
>>
>>
>> Can you help me ? Please.
>>
>> Thanks in advance.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "sonata-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/sonata-users.
>
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"sonata-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sonata-users.
For more options, visit https://groups.google.com/d/optout.