Skip to content

Commit a300f2e

Browse files
Merge pull request #5 from MelvinAchterhuis/feature/theme-icons
Feature/theme icons
2 parents 3d7463e + 4cdea32 commit a300f2e

File tree

6 files changed

+50
-6
lines changed

6 files changed

+50
-6
lines changed

CHANGELOG_de-DE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# 1.0.2
2+
3+
- Konfiguration für benutzerdefinierte Themesymbole hinzugefügt
4+
5+
# 1.0.1
6+
7+
- Symbol-Shortcode hinzugefügt
8+
19
# 1.0.0
210

311
- Erster Release des Plugins

CHANGELOG_en-GB.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# 1.0.2
2+
3+
- Added configuration for custom theme icons
4+
5+
# 1.0.1
6+
7+
- Added icon shortcode
8+
19
# 1.0.0
210

311
- Initial release of the plugin

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ After the plugin installation, you are now able to use these three shortcodes fr
1616
* `{{ category=firstCategoryId,secondCategoryId }}`
1717
* `{{ icon=ICONNAME }}`, for example `{{ icon=heart }}`
1818

19+
After installation you also have a config option for the plugin to use custom theme icons, this can be enabled in the plugin configuration.
20+
1921
*We're currently working on more Shortcodes, like for example to have the ability to create columns with Shortcodes.*
2022

2123
![Shortcode in texteditor](https://res.cloudinary.com/dtgdh7noz/image/upload/v1624259577/Bildschirmfoto_2021-06-21_um_10.10.54_nm7kke.png)

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Use Wordpress like Shortcodes within the Text Editor of Shopware",
44
"type": "shopware-platform-plugin",
55
"license": "MIT",
6-
"version": "1.0.1",
6+
"version": "1.0.2",
77
"keywords": ["shortcode", "shopware"],
88
"authors":[
99
{

src/Resources/config/config.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/shopware/platform/master/src/Core/System/SystemConfig/Schema/config.xsd">
3+
<card>
4+
<title>General Settings</title>
5+
6+
<input-field type="bool">
7+
<name>themeIcons</name>
8+
9+
<label>Use theme icons</label>
10+
<label lang="de-DE">Verwenden Sie Themensymbole</label>
11+
<label lang="nl-NL">Thema iconen gebruiken</label>
12+
</input-field>
13+
</card>
14+
</config>
Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
{% block sas_shortcode_component_icon %}
2-
{% for item in icon %}
3-
{% sw_include "@Storefront/storefront/utilities/icon.html.twig" with {
4-
'name': item
5-
} %}
6-
{% endfor %}
2+
{% if config('SasShortcode.config.themeIcons') %}
3+
{# Custom theme icons #}
4+
{% set namespace = app.request.get('theme-name') %}
5+
{% for item in icon %}
6+
{% sw_include "@Storefront/storefront/utilities/icon.html.twig" with {
7+
'name': item,
8+
'namespace': namespace
9+
} %}
10+
{% endfor %}
11+
{% else %}
12+
{# Default icons #}
13+
{% for item in icon %}
14+
{% sw_include "@Storefront/storefront/utilities/icon.html.twig" with {
15+
'name': item
16+
} %}
17+
{% endfor %}
18+
{% endif %}
719
{% endblock %}

0 commit comments

Comments
 (0)