{#

This file is part of the Sonata package.

(c) Thomas Rabaix <thomas.rabaix@sonata-project.org>

For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.

#}

{% extends '@SonataAdmin/CRUD/base_show_field.html.twig' %}

{% block field %}
    {%- set route = field_description.option('route') -%}
    {%- if route is not null and route.identifier_parameter_name is defined -%}
        {%- set newParameters = {(route.identifier_parameter_name):(admin.normalizedidentifier(object))} -%}
        {%- set route = route|merge({parameters: route.parameters|default([])|merge(newParameters)}) -%}
    {%- endif -%}

    {%- include '@SonataAdmin/CRUD/display_url.html.twig' with {
        value: value,
        url: field_description.option('url'),
        route: route,
        hide_protocol: field_description.option('hide_protocol'),
        attributes: field_description.option('attributes'),
        safe: field_description.option('safe'),
    } only -%}
{% endblock %}
