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 @@ ...@@ -16,6 +16,13 @@
<locale group="quiqqer/timeline" var="brick.timeline.setting.site"/> <locale group="quiqqer/timeline" var="brick.timeline.setting.site"/>
</setting> </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"> <setting name="imageFillMode" type="select">
<locale group="quiqqer/timeline" <locale group="quiqqer/timeline"
var="brick.timeline.setting.imageFillMode"/> var="brick.timeline.setting.imageFillMode"/>
......
...@@ -68,12 +68,12 @@ ...@@ -68,12 +68,12 @@
<locale name="brick.timeline.setting.limit"> <locale name="brick.timeline.setting.limit">
<de><![CDATA[Maximale Anzahl]]></de> <de><![CDATA[Limit]]></de>
<en><![CDATA[Limit]]></en> <en><![CDATA[Limit]]></en>
</locale> </locale>
<locale name="brick.timeline.setting.limit.desc"> <locale name="brick.timeline.setting.limit.desc">
<de><![CDATA[Legt die maximale Anzahl der Einträge fest.]]></de> <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[Sets the maximum number of items to display.]]></en> <en><![CDATA[This setting allows you to limit the number of displayed entries. To show all entries, please leave the field empty.]]></en>
</locale> </locale>
</groups> </groups>
...@@ -85,6 +85,15 @@ ...@@ -85,6 +85,15 @@
<en><![CDATA[Timeline: settings]]></en> <en><![CDATA[Timeline: settings]]></en>
</locale> </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 --> <!-- template / display -->
<locale name="timeline.display"> <locale name="timeline.display">
<de><![CDATA[Vorlage]]></de> <de><![CDATA[Vorlage]]></de>
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<!-- list attributes --> <!-- list attributes -->
<attributes> <attributes>
<attribute>quiqqer.timeline.limit</attribute>
<attribute default="VerticalBothSides">quiqqer.timeline.display</attribute> <attribute default="VerticalBothSides">quiqqer.timeline.display</attribute>
<attribute default="0">quiqqer.timeline.showLinks</attribute> <attribute default="0">quiqqer.timeline.showLinks</attribute>
<attribute default="cover">quiqqer.timeline.imageFillMode</attribute> <attribute default="cover">quiqqer.timeline.imageFillMode</attribute>
...@@ -25,6 +26,20 @@ ...@@ -25,6 +26,20 @@
var="timeline.settings.title"/> var="timeline.settings.title"/>
</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"> <select conf="quiqqer.timeline.display">
<text> <text>
<locale group="quiqqer/timeline" <locale group="quiqqer/timeline"
......
...@@ -28,7 +28,7 @@ public function __construct($attributes = []) ...@@ -28,7 +28,7 @@ public function __construct($attributes = [])
'order' => 'c_date ASC', 'order' => 'c_date ASC',
'showLinks' => true, 'showLinks' => true,
'template' => 'VerticalBothSides', 'template' => 'VerticalBothSides',
'limit' => 10 'limit' => false
]); ]);
parent::__construct($attributes); parent::__construct($attributes);
...@@ -47,10 +47,10 @@ public function getBody(): string ...@@ -47,10 +47,10 @@ public function getBody(): string
$Engine = QUI::getTemplateManager()->getEngine(); $Engine = QUI::getTemplateManager()->getEngine();
$Control = new QUI\Timeline\Controls\Timeline(); $Control = new QUI\Timeline\Controls\Timeline();
$limit = $this->getAttribute('limit'); $limit = false;
if (!$limit || $limit < 1) { if ($this->getAttribute('limit') >= 1) {
$limit = 10; $limit = $this->getAttribute('limit');
} }
$attributes = [ $attributes = [
......
...@@ -32,7 +32,7 @@ public function __construct(array $attributes = []) ...@@ -32,7 +32,7 @@ public function __construct(array $attributes = [])
'parentInputList' => false, //todo später für brick 'parentInputList' => false, //todo später für brick
'showLinks' => true, 'showLinks' => true,
'display' => 'VerticalBothSides', 'display' => 'VerticalBothSides',
'limit' => 10, 'limit' => false,
'imageFillMode' => 'cover', // cover / contain 'imageFillMode' => 'cover', // cover / contain
// Custom children template (path to html file); overwrites "display" // Custom children template (path to html file); overwrites "display"
'displayTemplate' => false, 'displayTemplate' => false,
...@@ -62,7 +62,12 @@ public function getBody(): string ...@@ -62,7 +62,12 @@ public function getBody(): string
return ''; return '';
} }
$limit = $this->getAttribute('limit') ?: 10; $limit = false;
if ($this->getAttribute('limit') >= 1) {
$limit = $this->getAttribute('limit');
}
$parents = $this->getAttribute('parentInputList') ?: $Site->getId(); $parents = $this->getAttribute('parentInputList') ?: $Site->getId();
// only active sites // only active sites
......
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
'showLinks' => $Site->getAttribute('quiqqer.timeline.showLinks'), 'showLinks' => $Site->getAttribute('quiqqer.timeline.showLinks'),
'itemtype' => 'http://schema.org/ItemList', 'itemtype' => 'http://schema.org/ItemList',
'child-itemtype' => 'http://schema.org/ListItem', '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([ $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