|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
T. Smarty Regular
Joined: 22 Aug 2004 Posts: 69 Location: AT
|
Posted: Mon Nov 22, 2004 7:28 pm Post subject: Section in 2 Spalten splitten |
|
|
Hallo Leute!
Folgendes Problem. Ich habe eine section, die sieht gekürzt so aus:
Code: |
{section name=count loop=$Glossar step=2}
<tr>
<td><strong>{$Glossar[count].Titel}</strong></td>
tr>
{/section}
|
jetz möchte ich, das ganze 2 spaltig machen also nicht
A
B
C
D
sondern:
A C
B D
es ist ja noch reicht einfach das ganze so:
A B
C D
zu gestalten, aber dann steh ich leider an.
gibt es in smarty sections irgendwie die möglichkeit die gesamtanzahl der einträge anzeigen zu lassen? hab zwar schon mein tutorial durchforstet aber nichts gefunden (index_next und prev nutzt nix, first und last gibt mir auch nur zurück ob gerade erstes oder letztes item).
Ansonsten wird mir nichts überbleiben als mit PHP zwei Arrays zu übergeben, die ich dann anzeige - will ich aber nicht, da auch leicht umständlich.
Hoffe jemand kennt sich aus und kann mir helfen
mfg Thomas _________________ Oppossom - Heavy rock from austria |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Tue Nov 23, 2004 8:30 am Post subject: |
|
|
die gesamtzahl kriegst du mit {$smarty.section.foo.total}
wenn der inhalt deiner table-cells nicht zu kompliziert zu generieren ist (evtl. willst du bloß ein array ausgeben), dann bist du mit {html_table} gut bedient. |
|
Back to top |
|
ZakMc Smarty Pro
Joined: 04 Oct 2004 Posts: 182
|
Posted: Tue Nov 23, 2004 11:13 am Post subject: |
|
|
oder du machst einfach eine 2te section um das td |
|
Back to top |
|
T. Smarty Regular
Joined: 22 Aug 2004 Posts: 69 Location: AT
|
Posted: Thu Nov 25, 2004 7:45 pm Post subject: |
|
|
danke, das mit total bringt mich schon weiter.
2. section ums td bringts ned, dann hab ich das ergebnis das ich ned haben will (immer 2 aufeinanderfolgende datensätze nebeneinander)
jetz hab ich aber das ganze mit 3 spalten gemacht und bräuchte eine funktion zum runden. gibts sowas in smarty?
mfg Thomas _________________ Oppossom - Heavy rock from austria |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|