<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>Contao-Community - Modifizierte Templates</title>
		<link>https://community.contao.org/de/</link>
		<description>Nutzer können hier modifizierte Modul-Templates zum Nachbauen bereitstellen</description>
		<language>de</language>
		<lastBuildDate>Wed, 23 Sep 2026 13:51:02 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>1</ttl>
		<image>
			<url>https://community.contao.org/de/images/misc/rss.png</url>
			<title>Contao-Community - Modifizierte Templates</title>
			<link>https://community.contao.org/de/</link>
		</image>
		<item>
			<title>5.7.x form.radio_twig Parameter übergeben</title>
			<link>https://community.contao.org/de/showthread.php?89442-form-radio_twig-Parameter-übergeben&amp;goto=newpost</link>
			<pubDate>Wed, 02 Sep 2026 09:22:38 GMT</pubDate>
			<description>Hi, 
 
ich habe eine Formular mit Bedingungen.  
 
Unter anderem verwende ich vier Radio Options.  
Je nach Auswahl öffnet sich danach ein...</description>
			<content:encoded><![CDATA[<div>Hi,<br />
<br />
ich habe eine Formular mit Bedingungen. <br />
<br />
Unter anderem verwende ich vier Radio Options. <br />
Je nach Auswahl öffnet sich danach ein spezifisches Set an Feldern.<br />
<br />
Das Formular verwende ich auf verschiedenen Unterseiten. <br />
<br />
Ich würde gern mit meinedomain.tld?Anlass=VALUE eine Vorauswahl treffen.<br />
Ist weder Anlass vorhanden, noch stimmt Value überein möchte ich die Radio Buttons neutral stehen lassen. <br />
<br />
Im Formular würde ich das Twig-Template für die Radio Gruppe ändern in etwas wie folgt<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">HTML-Code:</div>
	<hr /><code class="bbcode_code">{% extends '@Contao/form_radio.html.twig' %}<br />
<br />
{% block field %}<br />
&nbsp; &nbsp; {% set anlassValue = app.request.query.get('Anlass') %}<br />
<br />
&nbsp; &nbsp; {% for option in options %}<br />
&nbsp; &nbsp; &nbsp; &nbsp; {% if option.type == 'option' %}<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;span&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;input<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; type=<span style="color:#0000FF">&quot;radio&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name=<span style="color:#0000FF">&quot;{{ option.name }}&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; id=<span style="color:#0000FF">&quot;opt_{{ option.id }}&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; class=<span style="color:#0000FF">&quot;radio&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; value=<span style="color:#0000FF">&quot;{{ option.value }}&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{ option.checked ? 'checked' }}<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{ option.attributes }}<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{ option.value == anlassValue ? 'checked' }}<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF8000">&lt;label id=<span style="color:#0000FF">&quot;lbl_{{ option.id }}&quot;</span> for=<span style="color:#0000FF">&quot;opt_{{ option.id }}&quot;</span>&gt;</span>{{ option.label }}<span style="color:#FF8000">&lt;/label&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;/span&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; {% endif %}<br />
&nbsp; &nbsp; {% endfor %}<br />
{% endblock %}</code><hr />
</div>Leider klappt das nicht so. <br />
Meine Conditional Field klappt mit diesem Template immer alles auf. <br />
Egal was in der URL steht</div>

]]></content:encoded>
			<category domain="https://community.contao.org/de/forumdisplay.php?68-Modifizierte-Templates">Modifizierte Templates</category>
			<dc:creator>Thomas Hinze</dc:creator>
			<guid isPermaLink="true">https://community.contao.org/de/showthread.php?89442-form-radio_twig-Parameter-übergeben</guid>
		</item>
		<item>
			<title>5.7.x Titel doppelt - content_element/text</title>
			<link>https://community.contao.org/de/showthread.php?89436-Titel-doppelt-content_element-text&amp;goto=newpost</link>
			<pubDate>Sun, 30 Aug 2026 14:52:19 GMT</pubDate>
			<description><![CDATA[Ich habe klassische Inhaltselement "Text" und möchte mehrere Templates erstellen, da ich  
 
Als erstes das Bild benötige, dann den Titel...]]></description>
			<content:encoded><![CDATA[<div>Ich habe klassische Inhaltselement &quot;Text&quot; und möchte mehrere Templates erstellen, da ich <br />
<br />
Als erstes das Bild benötige, dann den Titel (Überschrift), dann den Textblock und dann die Meta Angaben vom Bild wie URL und Caption.<br />
Ich verstehe Twig nach wie vor leider nicht und versuche mich schon mit LLMs zu behelfen, aber die kommen auch nicht klar. Die Templates die auf Basis der Doku von Contao in Twig erstellt werden funktionieren selten.<br />
<br />
<br />
Das hier ist das Standard Twig für &quot;Text&quot; <br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">HTML-Code:</div>
	<hr /><code class="bbcode_code">{% extends '@Contao/content_element/_base.html.twig' %}<br />
{% use '@Contao/component/_figure.html.twig' %}<br />
{% use '@Contao/component/_rich_text.html.twig' %}<br />
<br />
{% set content_layout_attributes = attrs()<br />
&nbsp; &nbsp; .addClass('media media--' ~ layout, layout and image)<br />
&nbsp; &nbsp; .mergeWith(content_layout_attributes|default)<br />
%}<br />
<br />
{# By default we add the layout attributes to the wrapper element. If you want to<br />
&nbsp;disable this behavior, set &quot;default_content_layout&quot; to false. #}<br />
{% set attributes = attrs(attributes|default)<br />
&nbsp; &nbsp; .mergeWith(content_layout_attributes, default_content_layout is not defined or default_content_layout)<br />
%}<br />
<br />
{# Media #}<br />
{% block text_media %}<br />
&nbsp; &nbsp; {% if image %}<br />
&nbsp; &nbsp; &nbsp; &nbsp; {% with {figure: image} %}{{ block('figure_component') }}{% endwith %}<br />
&nbsp; &nbsp; {% endif %}<br />
{% endblock %}<br />
<br />
{% block content %}<br />
&nbsp; &nbsp; {% if layout != 'below' %}<br />
&nbsp; &nbsp; &nbsp; &nbsp; {{ block('text_media') }}<br />
&nbsp; &nbsp; {% endif %}<br />
<br />
&nbsp; &nbsp; {# Richtext #}<br />
&nbsp; &nbsp; {% block text %}<br />
&nbsp; &nbsp; &nbsp; &nbsp; {% with {text, attributes: text_attributes|default} %}{{ block('rich_text_component') }}{% endwith %}<br />
&nbsp; &nbsp; {% endblock %}<br />
<br />
&nbsp; &nbsp; {% if layout == 'below' %}<br />
&nbsp; &nbsp; &nbsp; &nbsp; {{ block('text_media') }}<br />
&nbsp; &nbsp; {% endif %}<br />
{% endblock %}</code><hr />
</div>Ich möchte einfach nur (wenn vorhanden) das Bild zuerst, danach (wenn vorhanden) den Titel, danach (wenn vorhanden) den Text, danach (wenn vorhanden) einen Hyperlink aus der Meta Angabe &quot;URL&quot; des Bildes und als Linktext den Meta Titel der URL <br />
<br />
ich bekomme solche Vorschläge<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">HTML-Code:</div>
	<hr /><code class="bbcode_code">{% extends '@Contao/content_element/_base.html.twig' %}<br />
{% use '@Contao/component/_figure.html.twig' %}<br />
{% use '@Contao/component/_rich_text.html.twig' %}<br />
{# Headline-Block leer lassen #}<br />
{% block headline %}{% endblock %}<br />
{% block content %}<br />
&nbsp; &nbsp; {% if image %}<br />
&nbsp; &nbsp; &nbsp; &nbsp; {% if image.linkHref %}<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000">&lt;a href=<span style="color:#0000FF">&quot;{{ image.linkHref }}&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  {% if image.linkTitle %}title=&quot;{{ image.linkTitle }}&quot;{% endif %}<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  {{ image.linkAttributes|default('')|raw }}&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {% with {figure: image} %}{{ block('figure_component') }}{% endwith %}<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000">&lt;/a&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; {% else %}<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {% with {figure: image} %}{{ block('figure_component') }}{% endwith %}<br />
&nbsp; &nbsp; &nbsp; &nbsp; {% endif %}<br />
&nbsp; &nbsp; {% endif %}<br />
<br />
&nbsp; &nbsp; {# 2. Headline #}<br />
&nbsp; &nbsp; {% if headline.text %}<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;{{ headline.tag|default('h3') }}&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{ headline.text }}<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;/{{ headline.tag|default('h3') }}&gt;</span><br />
&nbsp; &nbsp; {% endif %}<br />
<br />
&nbsp; &nbsp; {# 3. Text #}<br />
&nbsp; &nbsp; {% block text %}<br />
&nbsp; &nbsp; &nbsp; &nbsp; {% with {text, attributes: text_attributes|default} %}<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{ block('rich_text_component') }}<br />
&nbsp; &nbsp; &nbsp; &nbsp; {% endwith %}<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; {% if image.linkHref %}<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000">&lt;a href=<span style="color:#0000FF">&quot;{{ image.linkHref }}&quot;</span>&gt;</span>Mehr erfahren<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  {% if image.linkTitle %}title=&quot;{{ image.linkTitle }}&quot;{% endif %}<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000">&lt;/a&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; {% endif %}<br />
&nbsp; &nbsp; &nbsp; &nbsp; {% endblock %}<br />
{% endblock %}</code><hr />
</div><br />
Der Titel (headline) wird im Frontend zweimal ausgegeben. <br />
Über dem Bild und darunter. <br />
Ich komme nicht an die Metabeschreibung &quot;titel&quot; vom Bild als Link-Text. Im Moment statisch eingetragen</div>

]]></content:encoded>
			<category domain="https://community.contao.org/de/forumdisplay.php?68-Modifizierte-Templates">Modifizierte Templates</category>
			<dc:creator>Thomas Hinze</dc:creator>
			<guid isPermaLink="true">https://community.contao.org/de/showthread.php?89436-Titel-doppelt-content_element-text</guid>
		</item>
	</channel>
</rss>
