{% set elements = value.all() %}

{% if elements | length %}
    <ul>
        {% for element in elements %}
            {% set url = field.emailValue == 'cpUrl' ? element.getCpEditUrl() : element.getUrl() %}
                
            <li>
                <a href="{{ url }}">{{ element.name }}</a>
            </li>
        {% endfor %}
    </ul>
{% endif %}