Random thoughts from ghenry

06 Aug

Catalyst and Random List Elements in TT

written by Gavin Henry

Another way to do Rand in TT

Marcus pointed out how he does it with Catalyst for iusethis

I asked last month how to use rand in TT.

So here's how we do it at Suretec

[% USE Math %] [% did_you_know = [ 'Open Source can provide you with VoIP', 'Open Source can provide you with Sane Software Deployments and Upgrades', 'Open Source can provide you with I.T. that works for You!',] %] [% did_you_know.${Math.rand(did_you_know.size)} %]

Above is bigger, but snipped for this post.


[% PROCESS did_you_know.tt %]


Avatar On Nov 04 2006 at 08:58
Anonymous wrote:


Your captcha is:

Only the comment itself is required, but if you supply your email we'll gladly load your gravatar. We won't use your email for any other purpose or sell it to nigerian business men. Promise.
A live preview of your comment will appear in this box.