|
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 |
SoundOfSilence88 Smarty n00b
Joined: 24 Oct 2012 Posts: 1
|
Posted: Wed Oct 24, 2012 9:17 am Post subject: Zufallszahl ohne Plugin? |
|
|
Hi Leute...
ich bin neu hier und hab auch gleich eine Frage:
Ich habe vor die Artikelboxen verschieden zu gestalten. Dabei sollen diese zufällig bei jedem neu laden ausgegeben werden. so zu sagen.
Es soll also wie folgt aussehen:
Artikelbox 1 hat Nummer 3
Artikelbox 2 hat Nummer 6
Artikelbox 3 hat Nummer 1
und beim nächsten laden dann
Artikelbox 1 hat Nummer 2
Artikelbox 2 hat Nummer 1
Artikelbox 3 hat Nummer 5
dass ich quasi ohne viel Aufwand den Hintergrund da ändern kann....
Allerdings möchte ich das ganze nicht unbedingt mit einem Plugin machen.
Kann mir da jemand helfen?
LG
Sound of Silence 88 |
|
Back to top |
|
Grizzly Smarty Pro
Joined: 15 Apr 2011 Posts: 172 Location: Germany
|
Posted: Thu Oct 25, 2012 6:24 am Post subject: |
|
|
Ja wie wird denn der Inhalt der "Artikelbox" ausgegeben? Mittels Code oder nicht? Wenn ja, dann kannst dus ja dort machen
Ansonsten habe ich folgendes im inet gefunden:
Code: | {assign var='random' value=1|rand:n} |
Musst n nur mit der Zahl austauschen, die die höchste zufallszahl sein darf. zum Beispiel 10. Dann bekommst du zufallswerte zwischen 1 und 10 |
|
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
|