PDA

Shop Support News Archive - Shopbetreiber News -> Forum : Smarty li Elemente zaehlen und mehr ... ???


Ostfront
25.03.2010, 13:42
So heute mal ich mit einem kleinen Problem wo ich derzeit etwas dran knaubeln muss.

Ich habe eine Menuestrucktur welche 100 li Elemente enthält. Ich habe 4 Div container ( col1, col2, col3, col4).

Wie bringe ich Sarty dazu alle 25 li Elemente in ein neues Div zu schreiben? Also li 1-24 in col1, 25-50 in col2, etc.

Die li Elemente werden schon durchgezählt.

Das Hauptproblem ist, das ich sction loop und count nicht zusammenbekomme.

Wenn also einer eine Idee hat, immer raus damit

hh-cm
25.03.2010, 15:29
Gehen wir mal davon aus, das dein loop bar heisst ;)


{section name=foo loop=$bar}
{if $smarty.section.foo.iteration % 25 == 1}<div>{/if}
{$bar[foo]}
{if $smarty.section.foo.iteration % 25 == 0}</div>{/if}
{/section}

Ostfront
25.03.2010, 16:40
mohar ich bin doof ... warum einfach, wenn es auch schwer geht

Danke Chris für die richtige RIchtung ..