show_html.html.twig 787 B

1234567891011121314151617181920
  1. {% extends 'SonataAdminBundle:CRUD:base_show_field.html.twig' %}
  2. {% block field%}
  3. {%- if value is empty -%}
  4.  
  5. {% else %}
  6. {%- if field_description.options.truncate is defined -%}
  7. {% set truncate = field_description.options.truncate %}
  8. {% set length = truncate.length|default(30) %}
  9. {% set preserve = truncate.preserve|default(false) %}
  10. {% set separator = truncate.separator|default('...') %}
  11. {{ value|striptags|truncate(length, preserve, separator)|raw }}
  12. {%- else -%}
  13. {%- if field_description.options.strip is defined -%}
  14. {% set value = value|striptags %}
  15. {%- endif -%}
  16. {{ value|raw }}
  17. {% endif %}
  18. {% endif %}
  19. {% endblock %}