Skip to content
Code-Schnipsel Gruppen Projekte
Commit 0360a78d erstellt von Michael Danielczok's avatar Michael Danielczok
Dateien durchsuchen

feat: Children slider reworked. Default template works like before.

Übergeordneter 9c5e6cc2
No related branches found
No related tags found
Keine zugehörigen Merge Requests gefunden
...@@ -132,13 +132,19 @@ ...@@ -132,13 +132,19 @@
<locale group="quiqqer/bricks" var="brick.control.setting.template"/> <locale group="quiqqer/bricks" var="brick.control.setting.template"/>
<option value="onlyImage" selected="selected"> <option value="onlyImage" selected="selected">
<locale group="quiqqer/bricks" var="brick.control.setting.template.onlyImages"/> <locale group="quiqqer/bricks"
var="brick.control.setting.template.onlyImages"/>
</option> </option>
<option value="imageAndText" selected="selected"> <option value="imageAndText" selected="selected">
<locale group="quiqqer/bricks" var="brick.control.setting.template.onlyImages"/> <locale group="quiqqer/bricks"
var="brick.control.setting.template.imageAndText"/>
</option> </option>
</setting> </setting>
<setting name="slideHeight" type="number" min="1">
<locale group="quiqqer/bricks" var="brick.control.setting.slideHeight"/>
</setting>
<setting name="limit" type="number" min="1"> <setting name="limit" type="number" min="1">
<locale group="quiqqer/bricks" var="brick.control.setting.limit"/> <locale group="quiqqer/bricks" var="brick.control.setting.limit"/>
</setting> </setting>
......
...@@ -330,6 +330,22 @@ ...@@ -330,6 +330,22 @@
<de><![CDATA[Seiten hinzufügen]]></de> <de><![CDATA[Seiten hinzufügen]]></de>
<en><![CDATA[Add pages]]></en> <en><![CDATA[Add pages]]></en>
</locale> </locale>
<locale name="brick.control.setting.template">
<de><![CDATA[Slider Vorlage (template)]]></de>
<en><![CDATA[Slider template]]></en>
</locale>
<locale name="brick.control.setting.template.onlyImages">
<de><![CDATA[Nur Bild (standard)]]></de>
<en><![CDATA[Only image (default)]]></en>
</locale>
<locale name="brick.control.setting.template.imageAndText">
<de><![CDATA[Bild, Titel und Beschreibung]]></de>
<en><![CDATA[Image, title and description]]></en>
</locale>
<locale name="brick.control.setting.slideHeight">
<de><![CDATA[Slider Höhe]]></de>
<en><![CDATA[Slider height]]></en>
</locale>
<locale name="brick.control.setting.limit"> <locale name="brick.control.setting.limit">
<de><![CDATA[Limit]]></de> <de><![CDATA[Limit]]></de>
<en><![CDATA[Limit]]></en> <en><![CDATA[Limit]]></en>
......
...@@ -82,6 +82,7 @@ ...@@ -82,6 +82,7 @@
-webkit-transition: all 1s ease; -webkit-transition: all 1s ease;
max-height: calc(100% - 2px); max-height: calc(100% - 2px);
width: auto; width: auto;
max-width: initial;
} }
.quiqqer-bricks-children-slider-child-display img:hover { .quiqqer-bricks-children-slider-child-display img:hover {
......
...@@ -23,22 +23,18 @@ public function __construct($attributes = []) ...@@ -23,22 +23,18 @@ public function __construct($attributes = [])
{ {
// default options // default options
$this->setAttributes([ $this->setAttributes([
'class' => 'quiqqer-bricks-children-slider', 'class' => 'quiqqer-bricks-children-slider',
'nodeName' => 'section', 'nodeName' => 'section',
'site' => '', 'site' => '',
'order' => false, 'order' => false,
'limit' => false, 'limit' => false,
'moreLink' => false, 'moreLink' => false,
'data-qui' => 'package/quiqqer/bricks/bin/Controls/Children/Slider', 'data-qui' => 'package/quiqqer/bricks/bin/Controls/Children/Slider',
'template' => null, // default -> onlyImage 'template' => false, // default -> onlyImage
'data-qui-options-usemobile' => false 'data-qui-options-usemobile' => false
]); ]);
$this->addCSSFile(
dirname(__FILE__).'/Slider.css'
);
parent::__construct($attributes); parent::__construct($attributes);
} }
...@@ -52,7 +48,11 @@ public function getBody() ...@@ -52,7 +48,11 @@ public function getBody()
$Engine = QUI::getTemplateManager()->getEngine(); $Engine = QUI::getTemplateManager()->getEngine();
$MoreLink = null; $MoreLink = null;
if (!$this->getAttribute('height')) { if (!$this->getAttribute('slideHeight')) {
$this->setAttribute('slideHeight', $this->getAttribute('height'));
}
if (!$this->getAttribute('slideHeight')) {
$this->setAttribute('slideHeight', 200); $this->setAttribute('slideHeight', 200);
} }
...@@ -64,16 +64,19 @@ public function getBody() ...@@ -64,16 +64,19 @@ public function getBody()
} }
$template = $this->getTemplate(); $template = $this->getTemplate();
$css = $this->getTemplate();
switch ($this->getAttribute('template')) { switch ($this->getAttribute('template')) {
case 'onlyImage': case 'onlyImage':
$template = dirname(__FILE__).'/Slider.OnlyImage.html'; $template = dirname(__FILE__).'/Slider.OnlyImage.html';
$css = dirname(__FILE__).'/Slider.OnlyImage.css';
break; break;
case 'imageAndText': case 'imageAndText':
$template = dirname(__FILE__).'/Slider.ImageAndText.html'; $template = dirname(__FILE__).'/Slider.ImageAndText.html';
$css = dirname(__FILE__).'/Slider.ImageAndText.css';
if (!$this->getAttribute('slideHeight')) { if (!$this->getAttribute('slideHeight')) {
$this->setAttribute('slideHeight', 400); $this->setAttribute('slideHeight', 500);
} }
break; break;
} }
...@@ -84,6 +87,8 @@ public function getBody() ...@@ -84,6 +87,8 @@ public function getBody()
'MoreLink' => $MoreLink 'MoreLink' => $MoreLink
]); ]);
$this->addCSSFile($css);
return $Engine->fetch($template); return $Engine->fetch($template);
} }
...@@ -97,6 +102,16 @@ protected function getTemplate() ...@@ -97,6 +102,16 @@ protected function getTemplate()
return dirname(__FILE__).'/Slider.OnlyImage.html'; return dirname(__FILE__).'/Slider.OnlyImage.html';
} }
/**
* Return the control css
*
* @return string
*/
protected function getCSS()
{
return dirname(__FILE__).'/Slider.OnlyImage.css';
}
/** /**
* Return the children * Return the children
* *
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren