Standard Überschrift im Twig-Template
Über die 'standardFields' kann auch im rsce_dummy.html.twig auf die Überschrift zugegriffen werden:
Code:
<?php
// rsce_dummy_config.php
return [
'label' => ['Button-Box','Erstellen Sie eine Button-Box.'],
'types' => ['content'],
'contentCategory' => 'texts',
'standardFields' => ['headline','cssID'],
'fields' => [
....
]
];
Im Twig-Template entweder {% block content %}:
Code:
{# rsce_dummy.html.twig #}
{% extends "@Contao/content_element/_base.html.twig" %}
{% block content %}
....
{% endblock %}
oder ohne {% block content %} nur mit {% block headline %}
Code:
{# rsce_dummy.htmltwig #}
{% block headline %}
{% if headline.text %}
{% include '@Contao/component/_headline.html.twig' with { headline: headline } %}
{% endif %}
{% endblock %}
....
Danke an Sebastian, für den Hinweis!