Skip to content

rsce-hero.html.twig

rsce_hero.html.twig
{% extends "@Contao/content_element/_base.html.twig" %}
{%- block inner %}
{% block content %}
<div class="hero_image">
{{ contao_figure(hero_image|default, image_size|default) }}
</div>
{% if headline.text or textarea|default %}
<div class="hero_text {% if text_position|default %}{{ text_position }}{% endif %}">
{% if headline.text %}
{{ block('headline_component') }}
{% endif %}
{% if textarea %}
<div class="rte">
{{ textarea|raw }}
</div>
{% endif %}
</div>
{% endif %}
{% endblock %}
{% endblock -%}
rsce_hero.config.php
<?php
return array(
'label' => array('Hero-Element', ''),
'types' => array('content'),
'standardFields' => array('headline', 'cssID'),
'wrapper' => array(
'type' => 'single',
),
'fields' => array(
'textarea' => array(
'label' => array('Textarea', ''),
'inputType' => 'textarea',
'eval' => array(
'tl_class' => 'clr',
'rte' => 'tinyMCE'
),
),
'hero_image' => array(
'label' => array('Hero-Bild', ''),
'inputType' => 'fileTree',
'eval' => array(
'fieldType' => 'radio',
'filesOnly' => true,
'tl_class' => 'w25',
),
),
'image_size' => array(
'label' => array('Bildgröße', 'Gewünschte Bildgröße auswählen'),
'inputType' => 'imageSize',
'options' => Contao\System::getContainer()->get('contao.image.sizes')->getAllOptions(),
'reference' => &$GLOBALS['TL_LANG']['MSC'],
'eval' => array(
'tl_class'=> 'w50',
'rgxp' => 'digit',
'includeBlankOption' => true,
),
),
'text_position' => array(
'label' => array('Textposition', 'Gewünschte Positionierung auswählen'),
'inputType' => 'select',
'options' => array(
'center-vh' => 'zentriert',
'left' => 'unten links',
'center'=> 'unten mitte',
'right' => 'unten rechts',
'custom' => 'individuell'
),
'eval' => array(
'tl_class'=> 'w25'
),
),
),
);