Re: list from field in database
hx <[email protected]> Tue, 11 Mar 2014 16:47:40 +0800
| Newsgroups | gmane.comp.lang.perl.modules.template-toolkit |
|---|---|
| Message-ID | <CAALPCHsqDxdymnya-TRZ2Y-4=a1-ma79JkA26n2n4is-SY8NYg@mail.gmail.com> |
http://www.template-toolkit.org/docs/manual/VMethods.html#method_split On Tue, Mar 11, 2014 at 4:33 PM, Gert van Oss <[email protected]> wrote: > hi, > > I have a database field that has a list of filenames (images) separated > with comma’s. Haven’t been successful in showing that via TT. Is it better > to create an array on another level or should something like this be > possible? > > [% PERL %] > list = split (/,/, artikelen.photo) ; > [% END %] > [% FOREACH e IN list %] > <img class="myfloater" src="[% request.uri_base %]/images/photo/[% e %]" > alt="" /> > [% END %] > > Thanks, > Gert > _______________________________________________ > templates mailing list > [email protected] > http://mail.template-toolkit.org/mailman/listinfo/templates > _______________________________________________ templates mailing list [email protected] http://mail.template-toolkit.org/mailman/listinfo/templates