{% if name is defined and name %} {% endif -%} {% set elements = (elements is defined ? elements : []) -%} {% set criteria = (criteria is defined and criteria ? criteria : null) -%} {% set sourceElementId = (sourceElementId is defined and sourceElementId ? sourceElementId : null) -%} {% from "_includes/forms" import text %}
{% for element in elements %} {% include "_elements/element" with { context: 'field' } %} {% endfor %}
{{ text({ width: 'auto', placeholder: selectionLabel, }) }}
{% set jsSettings = { id: id|namespaceInputId, name: name|namespaceInputName, tagGroupId: tagGroupId, sourceElementId: sourceElementId ?: null, targetSiteId: targetSiteId } %} {% js %} new Craft.TagSelectInput({{ jsSettings|json_encode|raw }}); {% endjs %}