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

fix: show all entries if no limit is set in settings

Übergeordneter 7a9c9c28
No related branches found
No related tags found
2 Merge Requests!9fix: show all entries if no limit is set in settings,!8Update 'next-3.x' with latest changes from 'main'
Pipeline #12770 mit Warnungen bestanden mit Phase
in 1 Minute und 10 Sekunden
......@@ -16,6 +16,13 @@
<locale group="quiqqer/timeline" var="brick.timeline.setting.site"/>
</setting>
<setting name="site" type="number">
<locale group="quiqqer/timeline" var="brick.timeline.setting.site"/>
<description>
<locale group="quiqqer/timeline" var="brick.timeline.setting.site"/>
</description>
</setting>
<setting name="imageFillMode" type="select">
<locale group="quiqqer/timeline"
var="brick.timeline.setting.imageFillMode"/>
......
......@@ -68,12 +68,12 @@
<locale name="brick.timeline.setting.limit">
<de><![CDATA[Maximale Anzahl]]></de>
<de><![CDATA[Limit]]></de>
<en><![CDATA[Limit]]></en>
</locale>
<locale name="brick.timeline.setting.limit.desc">
<de><![CDATA[Legt die maximale Anzahl der Einträge fest.]]></de>
<en><![CDATA[Sets the maximum number of items to display.]]></en>
<de><![CDATA[Mit dieser Einstellung kann die Anzahl der angezeigten Einträge begrenzt werden. Um alle Einträge anzuzeigen, muss das Feld leer bleiben.]]></de>
<en><![CDATA[This setting allows you to limit the number of displayed entries. To show all entries, please leave the field empty.]]></en>
</locale>
</groups>
......@@ -85,6 +85,15 @@
<en><![CDATA[Timeline: settings]]></en>
</locale>
<locale name="timeline.limit">
<de><![CDATA[Limit]]></de>
<en><![CDATA[Limit]]></en>
</locale>
<locale name="timeline.limit.desc">
<de><![CDATA[Mit dieser Einstellung kann die Anzahl der angezeigten Einträge begrenzt werden. Um alle Einträge anzuzeigen, muss das Feld leer bleiben.]]></de>
<en><![CDATA[This setting allows you to limit the number of displayed entries. To show all entries, please leave the field empty.]]></en>
</locale>
<!-- template / display -->
<locale name="timeline.display">
<de><![CDATA[Vorlage]]></de>
......
......@@ -11,6 +11,7 @@
<!-- list attributes -->
<attributes>
<attribute>quiqqer.timeline.limit</attribute>
<attribute default="VerticalBothSides">quiqqer.timeline.display</attribute>
<attribute default="0">quiqqer.timeline.showLinks</attribute>
<attribute default="cover">quiqqer.timeline.imageFillMode</attribute>
......@@ -25,6 +26,20 @@
var="timeline.settings.title"/>
</title>
<input conf="quiqqer.timeline.limit" type="number">
<text>
<locale group="quiqqer/timeline"
var="timeline.limit"
/>
</text>
<description>
<locale group="quiqqer/timeline"
var="timeline.limit.desc"
/>
</description>
</input>
<select conf="quiqqer.timeline.display">
<text>
<locale group="quiqqer/timeline"
......
......@@ -28,7 +28,7 @@ public function __construct($attributes = [])
'order' => 'c_date ASC',
'showLinks' => true,
'template' => 'VerticalBothSides',
'limit' => 10
'limit' => false
]);
parent::__construct($attributes);
......@@ -47,10 +47,10 @@ public function getBody(): string
$Engine = QUI::getTemplateManager()->getEngine();
$Control = new QUI\Timeline\Controls\Timeline();
$limit = $this->getAttribute('limit');
$limit = false;
if (!$limit || $limit < 1) {
$limit = 10;
if ($this->getAttribute('limit') >= 1) {
$limit = $this->getAttribute('limit');
}
$attributes = [
......
......@@ -32,7 +32,7 @@ public function __construct(array $attributes = [])
'parentInputList' => false, //todo später für brick
'showLinks' => true,
'display' => 'VerticalBothSides',
'limit' => 10,
'limit' => false,
'imageFillMode' => 'cover', // cover / contain
// Custom children template (path to html file); overwrites "display"
'displayTemplate' => false,
......@@ -62,7 +62,12 @@ public function getBody(): string
return '';
}
$limit = $this->getAttribute('limit') ?: 10;
$limit = false;
if ($this->getAttribute('limit') >= 1) {
$limit = $this->getAttribute('limit');
}
$parents = $this->getAttribute('parentInputList') ?: $Site->getId();
// only active sites
......
......@@ -9,7 +9,8 @@
'showLinks' => $Site->getAttribute('quiqqer.timeline.showLinks'),
'itemtype' => 'http://schema.org/ItemList',
'child-itemtype' => 'http://schema.org/ListItem',
'display' => $Site->getAttribute('quiqqer.timeline.display')
'display' => $Site->getAttribute('quiqqer.timeline.display'),
'limit' => $Site->getAttribute('quiqqer.timeline.limit')
]);
$Engine->assign([
......
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