Files
kantarciandClaude Opus 5 711af312af Pick images, pages, forms, sections and terms instead of typing ids and addresses
The share image and featured image of a page become image fields with the library dialog,
as do image settings of plugins. The editor offers forms, sections, categories and tags as
lists, a page search next to every link target and in text links, the redirect target has a
page search, and the form editor picks the reply field, the condition and the option images.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 09:35:05 +02:00

18 lines
1.3 KiB
Twig

{# Ein Bild aus der Mediathek als Formularfeld: Vorschau, Wählen oder Hochladen im Dialog,
Entfernen. Die Kennung steht nur im versteckten Feld - niemand soll sie abtippen müssen.
Erwartet: id, name, label, value, help (optional). #}
{% set item = value ? kant_media(value) : null %}
<div class="media-field" data-media-field role="group" aria-labelledby="{{ id }}-label">
<span class="media-field-label" id="{{ id }}-label">{{ label }}</span>
<input type="hidden" id="{{ id }}" name="{{ name }}" value="{{ value }}">
<div class="media-field-current">
<img class="media-field-thumb" alt="" width="96" height="64"{% if item %} src="{{ (item.variants|first).src }}"{% else %} hidden{% endif %}>
<span class="media-field-name" aria-live="polite">{{ item ? item.title : (value ? 'Bild nicht gefunden' : 'Kein Bild gewählt') }}</span>
</div>
<div class="media-field-actions">
<button type="button" class="secondary" data-media-choose>{{ value ? 'Anderes Bild wählen' : 'Bild wählen oder hochladen' }}</button>
<button type="button" class="text-button danger-text" data-media-remove{{ value ? '' : ' hidden' }}>Entfernen</button>
</div>
{% if help|default('') %}<p class="field-help">{{ help }}</p>{% endif %}
</div>