Kategorien - Thumbnails und Text möglich?

Ist es möglich, bei der Kategorieauswahl in der Hauptspalte auch die Thumbnails und den Text zusammen anzuzeigen? Es scheint nur entweder/oder zu gehen.

Ist das richtig und warum ist das so? Bei vielen Produkten ist dieses kleine Bild nicht 100%ig ausagekräftig und eindeutig.

Viele Grüße

Mario

Dazu gab es schon mehere Threads incl einer Lösung. Im Prinzip nur ein kleiner Template-Eingriff. Bitte mal suchen…

So habe es gerade mal getestet. Du must in der list.tpl die Stelle finden, wo geprüft wird, ob ein Kategorienbild vorhanden ist oder nicht. Aus der vorhandenen if/else-Prüfung:

    [{if $category->getIsVisible()}]
                    [{if $category->oxcategories__oxicon->value }]
                        <a id="test_MoreSubCatIco_[{$smarty.foreach.MoreSubCat.iteration}]" href="[{ $category->getLink() }]">
                            <img src="[{$category->getIconUrl() }]" alt="[{ $category->oxcategories__oxtitle->value }]">
                        </a>
                    [{else}]
                        <li><a id="test_MoreSubCat_[{$smarty.foreach.MoreSubCat.iteration}]" href="[{ $category->getLink() }]">[{ $category->oxcategories__oxtitle->value }][{ if $category->getNrOfArticles() > 0 }] ([{ $category->getNrOfArticles() }])[{/if}]</a></li>
                    [{/if}]
                [{/if}]

wird dann das hier:


                [{if $category->getIsVisible()}]
                        <li><a id="test_MoreSubCatIco_[{$smarty.foreach.MoreSubCat.iteration}]" href="[{ $category->getLink() }]"><img src="[{$category->getIconUrl() }]" alt="[{ $category->oxcategories__oxtitle->value }]"></a>
                        <a id="test_MoreSubCat_[{$smarty.foreach.MoreSubCat.iteration}]" href="[{ $category->getLink() }]">[{ $category->oxcategories__oxtitle->value }][{ if $category->getNrOfArticles() > 0 }] ([{ $category->getNrOfArticles() }])[{/if}]</a></li>
                [{/if}]

Jetzt fehlt nur noch ein wenig Styling per Html/css.

Danke! Probier ich gleich mal aus …

Viele Grüße

Mario

Also auch nach .tmp Leerung ändert sich gar nichts. Nur das Bild zu sehen, ohne Text.

Bist Du dir sicher, dass die list.tpl richtig ist? Auch nach kompletter Auskommentierung und tmp-Leerung sieht man die Bilder noch.

Viele Grüße

Mario

Gerade noch mal auf dem Testserver mit ner 4.4.5 Version getestet. Es funktioniert bei mir.
Eventuell falsch auskommentiert?
Ich würde auch den Quelltext umbauen und noch “zurechtkommentieren”.

Jetzt verstehe ich gar nichts mehr. Jetzt bekomme ich nach Code-Austausch eine weiße Seite und das hier:

[I][03-Feb-2011 15:09:11] PHP Fatal error: Smarty error: [in list.tpl line 64]: syntax error: unrecognized tag: if $category->getIsVisible() (Smarty_Compiler.class.php, line 446) in /Users/mario/Documents/Works/Budde_GmbH/shop_local/core/smarty/Smarty.class.php on line 1093[/I]

Dann ist irgendwo ein Syntax-Fehler.

Probier mal diesen kompletten Block aus:


            <ul class="list">
            [{foreach from=$oView->getSubCatList() item=category name=MoreSubCat}]
                [{if $category->getContentCats() }]
                    [{foreach from=$category->getContentCats() item=ocont name=MoreCms}]
                    <li><a id="test_MoreSubCms_[{$smarty.foreach.MoreSubCat.iteration}]_[{$smarty.foreach.MoreCms.iteration}]" href="[{$ocont->getLink()}]">[{ $ocont->oxcontents__oxtitle->value }]</a></li>
                    [{/foreach}]
                [{/if}]
                [{if $category->getIsVisible()}]                
                        <li><a id="test_MoreSubCatIco_[{$smarty.foreach.MoreSubCat.iteration}]" href="[{ $category->getLink() }]"><img src="[{$category->getIconUrl() }]" alt="[{ $category->oxcategories__oxtitle->value }]"><br>
                        [{ $category->oxcategories__oxtitle->value }][{ if $category->getNrOfArticles() > 0 }] ([{ $category->getNrOfArticles() }])[{/if}]</a></li>
                [{/if}]
            [{/foreach}]
            </ul>

Anbei auch nochmal die komplette list.tpl

Jau, das ging. Ich vergleiche gleich mal und suche den Knackpunkt. Schon mal herzlichen Dank dafür!

Viele Grüße

Mario

Ich habe gerade an dieser Umsetzung gearbeit und festgestellt, das es mit meiner vorgeschlagenen Lösung ein Problem gibt, wenn es auch Kategorien ohne hinterlegtes Icon gibt.

Die werden dann gar nicht mehr dargestellt. Hier die überarbeitete Lösung:


                [{if $category->getIsVisible()}]
                <li><a id="test_MoreSubCatIco_[{$smarty.foreach.MoreSubCat.iteration}]" href="[{ $category->getLink() }]">
                    [{if $category->oxcategories__oxicon->value }]
                        <img src="[{$category->getIconUrl() }]" alt="[{ $category->oxcategories__oxtitle->value }]">
                        <br />[{/if}]
                    [{/if}]
                    [{ $category->oxcategories__oxtitle->value }][{ if $category->getNrOfArticles() > 0 }] ([{ $category->getNrOfArticles() }])
                 </a></li>
                [{/if}]

Hallo und danke für die Lösung.

Ich bekomme viele leerer Raum im code und deswegen kann ich die breit nicht optimal im css überarbeiten.

Kennt jemand von wo es kommt?

http://www.gartenmoebelprofis.de/Lagerraeumung/

<li><a id="test_MoreSubCatIco_2" href="http://www.gartenmoebelprofis.de/Lagerraeumung/Liegen/">
                                            <img src="http://www.gartenmoebelprofis.de/out/pictures/icon/filter_liegen_cico.jpg" alt="Liegen">
                        <br>                                        Liegen                                
                           </a></li>

Ich kann es mit ein feste breite reparieren, aber that causes other things to break

I’ve discovered a more serious problem with this solution. The <a href> link applied to the last filter is then applied to many subsequent dom elements, causing a large amount of things to then become links.

Demo: http://www.gartenmoebelprofis.de/Dining/

Note: the whole [I]Serie,Material Gestell,[/I] etc panel is linked to ‘Gartentische’

That´s probably because you made some changes to the article-filter.

because your article filter is inside the same <li><span> which gets the link for Tische

check here Sessel:

<li>
<a id="test_MoreSubCatIco_3" href="http://www.gartenmoebelprofis.de/Gartenstuehle/">
<img src="http://www.gartenmoebelprofis.de/out/pictures/icon/icon_dining_sessel_cico.jpg" alt="Sessel"/>
<br/>
<span>Sessel </span>
</a>
</li>

and here Tische:

<li>
<a id="test_MoreSubCatIco_4" href="http://www.gartenmoebelprofis.de/Gartentische/">
<img src="http://www.gartenmoebelprofis.de/out/pictures/icon/icon_dining_tisch_cico.jpg" alt="Tische"/>
<br/>
<span>
Tische 
<form method="post" action="http://www.gartenmoebelprofis.de/index.php?" name="_filterlist" id="_filterlist">
<!-- GAF ZELECTGMP-21 original code was here, moved up -->
</span>
<div class="locator">
</a>
</li>

you need to move the <form method=“Post”… code behind the closing </span></a>, then it will not get this link.

From what I can tell, the form wouldn’t have been wrapped in an <a> unless it wasn’t properly closed by the previous statement. (from comment #9).

By looking at the source code produced, it seems to be that the closed tags for the <li> & the <a> are failing to be rendered to me.

ChristophH’s first solution renders the closing tags fine with the exception of the unnecessary image code when none exist.

Still trying to work this out if anyone has the time to have a closer look here.
I’d greatly appreciate it.


        	[{if $oView->hasVisibleSubCats()}]
            	[{ oxmultilang ident="LIST_SELECTOTHERCATS1" }]
            	<b>
            	[{$actCategory->oxcategories__oxtitle->value}]
            	</b>
            	[{ oxmultilang ident="LIST_SELECTOTHERCATS2" }]
           		<hr>
            	<ul class="list">
            [{foreach from=$oView->getSubCatList() item=category name=MoreSubCat}]
                [{if $category->getContentCats() }]
                    [{foreach from=$category->getContentCats() item=ocont name=MoreCms}]
                    <li><a id="test_MoreSubCms_[{$smarty.foreach.MoreSubCat.iteration}]_[{$smarty.foreach.MoreCms.iteration}]" href="[{$ocont->getLink()}]">[{ $ocont->oxcontents__oxtitle->value }]</a></li>
                    [{/foreach}]
                [{/if}]

                
                [{if $category->getIsVisible()}]
                <li class="wide"><a id="test_MoreSubCatIco_[{$smarty.foreach.MoreSubCat.iteration}]" href="[{ $category->getLink() }]">
                    [{if $category->oxcategories__oxicon->value }]
                        <img src="[{$category->getIconUrl() }]" alt="[{ $category->oxcategories__oxtitle->value }]">
                    [{/if}]
                    [{/if}]
                    [{ $category->oxcategories__oxtitle->value }][{ if $category->getNrOfArticles() > 0 }] ([{ $category->getNrOfArticles() }])
                 </a></li>
                [{/if}]
            [{/foreach}]
            </ul> 
                    [{/if}]

        [{if $oView->getAttributes() }]
            <form method="post" action="[{ $oViewConf->getSelfActionLink() }]" name="_filterlist" id="_filterlist">
            <div class="catfilter"></br>
                [{ $oViewConf->getHiddenSid() }]
                [{ $oViewConf->getNavFormParams() }]
                <input type="hidden" name="cl" value="[{ $oViewConf->getActiveClassName() }]">
                <input type="hidden" name="tpl" value="[{$tpl}]">
                <input type="hidden" name="fnc" value="executefilter">
		<table cellpadding="0" cellspacing="0">

I don’t really get why there appears to be an extra [{/if}] there after getIconUrl… but the template fails to render at all if I remove it.

@Hebsacker … Could you just check my code there and let me know if I have misunderstood your solution?

Ich bin jetzt auf das gleiche Problem gestoßen bei dem Versuch die Kategorieübersicht durch Bilder aufzuwerten, aber nicht auf den Text unter den Bildern zu verzichten. Ich hatte mich schon gefreut als der Ansatz von Cristoph (Post #9) das gewünschte Ergebnis erzielte - jedoch leider nur im Firefox. Als ich mir die Seite dann mal im Internet Explorer anschaute musste ich festellen, dass es dort leider ganz anders aussah. Dort wurde neben jedem Bild ein verlinktes transparentes Feld erstellt, in der gleichen Größe wie das Bild.
Meine Vermutung ist, dass der IE auch den “ausgeblendeten” Teil des Codes darstellt und daher jede Kategorie zweimal darstellt - einmal als Bild mit Text darunter und einmal als transparentes Feld.
Gibt es hierzu mittlerweile eine funktionierende Lösung?
Das einzige was zu funktionieren scheint ist es den Code aus Post #2 zu nehmen, nur müssen dann halt in allen Kategorien Bilder vorhanden sein.
Verwendet wird die Shop Version 4.4.8.

Please write in english in international forums part and use the german forum instead.

Try to use <!-- … --> additional to the smarty [{* … *}] tags.

Sorry, I was a bit confused as the thread starts off in German and suddenly changes into English on the second page. I also thought that this is the German section of the forum…?
Nevermind, I am more than willing to repeat my question in English if that increases my chance for getting a solution:
I have tried all the solutions in this thread to try and get pictures AND text displayed in the category overview. But non of the solutions seems to work properly. The solution from post #9 was very promising and gave perfect results in firefox, but the internet explorer interprets the code differently and show transparent fields (the size of the picture and linked to the same category) to the right of each picture.
The code from Post #2 works better, but that would mean that every category has to have a picture.
Has anyone found a working solution for this problem?
I am using the shop version 4.4.8.
Oh and another little issue - is there any way around having to manually upload the pictures? If i use the Upload function the picture gets resized to the “icon” resolution, which is too small.
But if i increase that resolution in the backend settings, the article icon picture resolution is also increased - which is not what i want.
@hebsacker I don´t quite know where to put the <!-- … --> tags in the code…?

ehm sorry - my fault… hab mich doch von dem englischen Post zwischendrin verwirren lassen… :o

Kommando zurück, wir sind ja im deutsche Foren-Teil :slight_smile:

[QUOTE=ict;81893]dass der IE auch den “ausgeblendeten” Teil des Codes darstellt und daher jede Kategorie zweimal darstellt - einmal als Bild mit Text darunter und einmal als transparentes Feld.[/QUOTE]

ich meinte das hier, einfach zusätzlich noch mit <!-- und --> umschließen.