feat: extended configuration for teaser popup/modal

This commit is contained in:
Björn Fromme
2024-11-14 17:14:09 +01:00
parent 45921ede54
commit cecd298a22
4 changed files with 62 additions and 4 deletions
@@ -65,11 +65,21 @@ class Concept extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements
*/
protected $teaser = '';
/**
* @var string
*/
protected $popupTitle = 'Hinweis';
/**
* @var string
*/
protected $popupText = '';
/**
* @var string
*/
protected $popupButtonLabel = 'Ok';
/**
* @var string
*/
@@ -197,6 +207,30 @@ class Concept extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements
return $this;
}
public function getPopupTitle()
{
return $this->popupTitle;
}
public function setPopupTitle($popupTitle)
{
$this->popupTitle = $popupTitle;
return $this;
}
public function getPopupButtonLabel()
{
return $this->popupButtonLabel;
}
public function setPopupButtonLabel($popupButtonLabel)
{
$this->popupButtonLabel = $popupButtonLabel;
return $this;
}
/**
* @return string
*/
@@ -25,14 +25,16 @@ return [
'types' => [
'1' => [
'showitem' => '--palette--;;top, --palette--;;naming, --palette--;;header, teaser, description,
description_extended, popup_text,
--div--;Bilder/Dateien, teaser_images, header_images, images',
description_extended,
--div--;Bilder/Dateien, teaser_images, header_images, images,
--div--;Popup, popup_text, --palette--;;popup',
],
],
'palettes' => [
'top' => ['showitem' => 'hidden,detail_page,code'],
'naming' => ['showitem' => 'name,headline'],
'header' => ['showitem' => 'header_title,header_subtitle'],
'popup' => ['showitem' => 'popup_title, popup_button_label'],
],
'columns' => [
@@ -216,6 +218,16 @@ return [
'renderType' => 'inputLink',
]
],
'popup_title' => [
'exclude' => 0,
'label' => 'Popup Titel',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim',
'default' => 'Hinweis',
],
],
'popup_text' => [
'exclude' => 0,
'label' => 'Popup Text',
@@ -228,6 +240,16 @@ return [
'enableRichtext' => true,
],
],
'popup_button_label' => [
'exclude' => 0,
'label' => 'Popup Button Label',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim',
'default' => 'Ok',
],
],
'teaser_images' => [
'exclude' => 0,
'label' => 'Teaserbild(er)',
@@ -527,7 +527,9 @@ CREATE TABLE tx_epproducts_domain_model_concept
detail_page varchar(255) DEFAULT '' NOT NULL,
products int(11) DEFAULT '0' NOT NULL,
teaser text NOT NULL,
popup_title varchar(255) DEFAULT '' NOT NULL,
popup_text text NOT NULL,
popup_button_label varchar(255) DEFAULT '' NOT NULL,
headline varchar(255) DEFAULT '' NOT NULL,
header_title varchar(255) DEFAULT '' NOT NULL,
header_subtitle varchar(255) DEFAULT '' NOT NULL,
@@ -11,7 +11,7 @@
<div class="absolute top-1/2 left-1/2 transform -translate-xy-1/2 w-full max-w-screen-lg px-4">
<div class="shadow flex items-center justify-between p-4 bg-concept-{concept.code} text-white rounded-t">
<span class="text-xl font-bold">
Hinweis
{concept.popupTitle}
</span>
<button type="button"
class="inline-block"
@@ -30,7 +30,7 @@
</h3>
{concept.popupText -> f:format.html()}
<a href="{targetUrl}" class="button bg-button">
Ok
{concept.popupButtonLabel}
</a>
</div>
</div>