Unser Warenwirtschaftsystem kann noch keine Kategoriebilder übertragen und die Programmierer waren so schlau, das diese bei jeder Aktualisierung die eingetragenen Bilder wieder löschen.
Darum habe ich mir in den Kategorien ein Freitextfeld erzeugt und wollte jetzt auf dieses zugreifen aber da hat sich ein neues Problem eröffnet.
Die URL zum Bild ist unter $sAdvancedMenu.0.sub.?.attribute.kategoriebild zu finden aber meine Abfrage funktioniert nur beim ersten Menüpunkt.
Kann man eventuell die {$category.id} mit der $sAdvancedMenu[0].sub.[?].attribute.categoryID abgleichen und dann den Inhalt von $sAdvancedMenu[0].sub.[?].attribute.kategoriebild ausgeben lassen, ohne das ich jetzt den Array in seine einzelteile zerlege und das bestenfalls ohne erneute Datenbankabfrage bzw, extra PHP Script, da es hoffentlich nur eine vorübergehende Lösung ist.
{block name="frontend_plugins_advanced_menu_list_item"}
{$category.name} {$category.id}
{$count++}
{$counter=$count-1}
{if $sAdvancedMenu[0].sub.$counter.attribute.kategoriebild}
{/if}
{if $category.sub}
{call name=categories_top categories=$category.sub level=$level+1}
{/if}
{debug}
{/block}
$sAdvancedMenu
Smarty_Variable Object (3)
->value = Array (7)
0 => Array (39)
id => 34
parentId => 3
name => "Serien"
position => 0
metaTitle => null
metaKeywords => null
metaDescription => null
cmsHeadline => null
cmsText => null
active => true
template => ""
productBoxLayout => "list"
blog => false
path => "|3|"
external => null
externalTarget => ""
hideFilter => false
hideTop => false
changed => null
added => null
attribute => Array (0)
attributes => Array (0)
media => null
mediaId => null
link => "shopware.php?sViewport=cat&sCategory=34"
streamId => null
productStream => null
childrenCount => 20
description => "Serien"
cmsheadline => null
cmstext => null
sSelf => "shopware.php?sViewport=cat&sCategory=34"
canonicalParams => Array (2)
sViewport => "cat"
sCategory => 34
hide_sortings => false
rssFeed => "shopware.php?sViewport=cat&sCategory=..."
atomFeed => "shopware.php?sViewport=cat&sCategory=..."
flag => false
sub => Array (20)
0 => Array (39)
id => 35
parentId => 34
name => "Test 1"
position => 0
metaTitle => ""
metaKeywords => null
metaDescription => ""
cmsHeadline => ""
cmsText => ""
active => true
template => ""
productBoxLayout => "list"
blog => false
path => "|3|34|"
external => ""
externalTarget => ""
hideFilter => false
hideTop => false
changed => null
added => null
attribute => Array (9)
id => "1"
categoryID => "35"
attribute1 => null
attribute2 => null
attribute3 => null
attribute4 => null
attribute5 => null
attribute6 => null
kategoriebild => "https://domain.tld/media/imag..."
attributes => Array (1)
core => Shopware\Bundle\StoreFrontBundle\Struct\Attribute Object (0)
media => null
mediaId => null
link => "shopware.php?sViewport=cat&sCategory=35"
streamId => null
productStream => null
childrenCount => 0
description => ""
cmsheadline => "Test 1"
cmstext => ""
sSelf => "shopware.php?sViewport=cat&sCategory=35"
canonicalParams => Array (2)
sViewport => "cat"
sCategory => 35
hide_sortings => false
rssFeed => "shopware.php?sViewport=cat&sCategory=..."
atomFeed => "shopware.php?sViewport=cat&sCategory=..."
flag => false
sub => Array (0)
activeCategories => 0
1 => Array (39)
id => 36
parentId => 34
name => "Test 2"
position => 1
metaTitle => ""
metaKeywords => null
metaDescription => ""
cmsHeadline => ""
cmsText => ""
active => true
template => null
productBoxLayout => "list"
blog => false
path => "|3|34|"
external => ""
externalTarget => ""
hideFilter => false
hideTop => false
changed => null
added => null
attribute => Array (9)
id => "2"
categoryID => "36"
attribute1 => null
attribute2 => null
attribute3 => null
attribute4 => null
attribute5 => null
attribute6 => null
kategoriebild => "https://domain.tld/media/imag..."
attributes => Array (1)
core => Shopware\Bundle\StoreFrontBundle\Struct\Attribute Object (0)
media => null
mediaId => null
link => "shopware.php?sViewport=cat&sCategory=36"
streamId => null
productStream => null
childrenCount => 0
description => "Type 301 HM"
cmsheadline => "CHROMA type 301 HM – Design by F.A. P..."
cmstext => "Mit Hammerschlag CHROMA t..."
sSelf => "shopware.php?sViewport=cat&sCategory=36"
canonicalParams => Array (2)
sViewport => "cat"
sCategory => 36
hide_sortings => false
rssFeed => "shopware.php?sViewport=cat&sCategory=..."
atomFeed => "shopware.php?sViewport=cat&sCategory=..."
flag => false
sub => Array (0)
activeCategories => 0
Irgendwie habe ich momentan ein Brett vorm Kopf, vielleicht kann mir da wer behilflich sein.