{% extends '@SonataAdmin/CRUD/base_show_field.html.twig' %}
{% block field %}
{%- if value is empty -%}
{% else %}
{%- if field_description.options.truncate is defined -%}
{% set truncate = field_description.options.truncate %}
{% set length = truncate.length|default(30) %}
{% if truncate.preserve is defined %}
{% deprecated 'The "truncate.preserve" option is deprecated since sonata-project/admin-bundle 3.65, to be removed in 4.0. Use "truncate.cut" instead.' %}
{% endif %}
{% set cut = truncate.cut is defined ? truncate.cut : (truncate.preserve is defined ? truncate.preserve != true : true) %}
{% if truncate.separator is defined %}
{% deprecated 'The "truncate.separator" option is deprecated since sonata-project/admin-bundle 3.65, to be removed in 4.0. Use "truncate.ellipsis" instead.' %}
{% endif %}
{% set ellipsis = truncate.ellipsis is defined ? truncate.ellipsis : (truncate.separator is defined ? truncate.separator : '...') %}
{{ value|striptags|sonata_truncate(length, cut == false, ellipsis)|raw }}
{%- else -%}
{%- if field_description.options.strip is defined -%}
{% set value = value|striptags %}
{%- endif -%}
{{ value|raw }}
{% endif %}
{% endif %}
{% endblock %}