Re: Numeric loops
Karen <[email protected]> Sun, 29 Apr 2007 19:22:11 -0500
| Newsgroups | gmane.comp.lang.perl.modules.html-template |
|---|---|
| Message-ID | <[email protected]> |
On 4/29/07, Dan Horne <[email protected]> wrote: > Is there a way to loop from a lower integer to an higher one? For example, > say an article has a rating of 4. I'd like to loop from 1 to 4 and print a > star at each iteration. The only way I can see of doing this is create an > array ref in the perl coder and pass that to the template, which seems a > lot > of pointless effort I've been trying to think of a way to do that with CSS, since currently I'd like to indent things based on a "level" variable passed through the template (and to complicate things, I'd like to max out at a certain point to avoid right-margin squish, considering that in a couple of cases the threads nest over two hundred levels deep). With (one assumes) a rating system with its own ceiling, though, you could go with img src="blahblah/star<TMPL_VAR name="rating">.gif" or what have you, and just have a set of graphics with star1.gif having one star, star2.gif having two stars, and so forth. ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Html-template-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/html-template-users