Skip to content

Commit

Permalink
feat: Added offset count functionality to the newest blog items element
Browse files Browse the repository at this point in the history
  • Loading branch information
7underlines committed Sep 14, 2024
1 parent 1b23775 commit 8ec29bf
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 4 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG_de-DE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# 3.0.4
- Überspringe-Artikel-Funktionalität für das neueste Blog-Artikel-Element

# 3.0.3
- Änderung des Git-Tag-Formats, sodass das Plugin über Composer installiert werden kann

# 3.0.2
- Umbenennung in OpenBlogware

# 3.0.1
- Kategoriererstellung behoben [#3](https://github.com/Werkstattl/OpenBlogware/pull/3)

# 3.0.0
- Kompatibilität mit Shopware 6.6
- Kompatibilität mit Shopware 6.6 [#2](https://github.com/Werkstattl/OpenBlogware/pull/2)

# 2.10.0
- Überprüfte die Liste der Blog-IDs, bevor der Cache ungültig gemacht wurde.
Expand Down
14 changes: 13 additions & 1 deletion CHANGELOG_en-GB.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# 3.0.4
- Added offset count functionality to the newest blog items element

# 3.0.3
- Changed git tag format so that the plugin can be installed via composer

# 3.0.2
- Renamed to OpenBlogware

# 3.0.1
- Fixed category creation [#3](https://github.com/Werkstattl/OpenBlogware/pull/3)

# 3.0.0
- Compatibility with Shopware 6.6
- Compatibility with Shopware 6.6 [#2](https://github.com/Werkstattl/OpenBlogware/pull/2)

# 2.10.0
- Checked list of blog ids before invalidating cache
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "werkstattl/openblogware",
"description": "OpenBlogware: A Blog Module for Shopware 6.",
"version": "3.0.3",
"version": "3.0.4",
"type": "shopware-platform-plugin",
"keywords": ["blog", "news"],
"license":"MIT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,15 @@ private function createCriteria(FieldConfigCollection $config, SalesChannelConte
$limit = (int) $itemCountConfig->getValue();
}

$offset = 0;
$offsetCountConfig = $config->get('offsetCount') ?? null;

if ($offsetCountConfig !== null && $offsetCountConfig->getValue()) {
$offset = (int) $offsetCountConfig->getValue();
}

$criteria->setLimit($limit);
$criteria->setOffset($offset);

return $criteria;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@
></sw-number-field>
{% endblock %}

{% block sas_cms_element_newest_listing_config_offsetCount_field %}
<sw-number-field
numberType="int"
:step="1"
:min="0"
:max="null"
v-model:value="element.config.offsetCount.value"
:digits="2"
:allowEmpty="false"
:label="$tc('sas-blog.elements.newestListing.config.offsetCount')"
></sw-number-field>
{% endblock %}

{% block sas_cms_element_blog_listing_config_show_type %}
<sw-select-field
:label="$tc('sas-blog.elements.newestListing.config.showType.label')"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ Shopware.Service('cmsService').registerCmsElement({
source: 'static',
value: 5,
},
offsetCount: {
source: 'static',
value: 0,
},
showType: {
source: 'static',
value: 'all',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
"newestListing": {
"config": {
"itemCount": "Anzahl der Artikel",
"offsetCount": "Überspringe Artikel",
"showType": {
"label": "Typ anzeigen",
"options": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
"newestListing": {
"config": {
"itemCount": "Item count",
"offsetCount": "Offset count",
"showType": {
"label": "Show type",
"options": {
Expand Down
Empty file modified src/Resources/public/administration/css/sas-blog-module.css
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion src/Resources/public/administration/js/sas-blog-module.js
100644 → 100755

Large diffs are not rendered by default.

0 comments on commit 8ec29bf

Please sign in to comment.