[Zope] Easy way to display a random image in ZPT

Jaroslav Lukesh lukesh at seznam.cz
Fri Mar 19 04:00:10 EST 2004


Michael Fox wrote:
> Hi *,
> 
> What's the easiest way to do the following DTML in ZPT?
> 
> <img src="images/<dtml-var
> expr="_.whrandom.choice(imgages.objectIds())">" />

Easy:

Save this DTML method as random_image:
----8<------8<------8<------8<------8<------8<--
<img src="images/<dtml-var 
expr="_.whrandom.choice(imgages.objectIds())">" />
----8<------8<------8<------8<------8<------8<--

and call this dtml method from your ZPT

Regards,

-- 

Jaroslav Lukeš

--
Tento e-mail nemu*že obsahovat VIRY
jelikož nepocházi z virózního systému M$ Windows!




More information about the Zope mailing list