[Zope-dev] Repeating a piece of HTML code

Steve Alexander steve@cat-box.net
Fri, 02 Jun 2000 13:46:49 +0100


Shane Hathaway wrote:
> 
> Alex Mendez wrote:
> >
> > Hello, it's the first time I write here and I'm a
> > newbie at Zope, so maybe I'm asking a stupid
> > question...
> >
> > Case is I retrieve from my movie database the value of
> > the movie from 1 to 5 stars. I would like to repeat
> > that n times the code <img SRC="star.gif" height=15
> > width=15> so the number of stars would appear:
> >
> > 1 - *
> > 2 - **
> > 3 - ***
> > 4 - ****
> > 5 - *****
> >
> > Is there any way to do so in Zope? Does the <dtml-in>
> > tag anything to do with it?
> 
> <dtml-in expr="_.range(0, movie_rating)">
>   <img SRC="star.gif" height=15 width=15>
> </dtml-in>
> 
> Replace movie_rating with the variable that represents the movie rating.

What about <dtml-var "'*' * movie_rating"> ?

--
Steve Alexander
Software Engineer
Cat-Box limited