Re: [Templates] populating dropdown box from db

2012-05-17 Thread Aaron Trevena
On 9 May 2012 17:22, wrote: > Use the TT wrapper for the CGI module and simply pass in an array of values > and a hash of value => label pairs as per the docs. Check the docs for CGI as > well as the TT CGI plugin. > [ 500 lines of untrimmed top-post ] Or you could go the whole hog and use htt

Re: [Templates] populating dropdown box from db

2012-05-10 Thread eric.berg
t; To: Mark Haney; templates@template-toolkit.org > Subject: Re: [Templates] populating dropdown box from db > > From: "Mark Haney" > Subject: [Templates] populating dropdown box from db > > > > HI all, I'm rather new to the TT, but so far I'm liking it&#

Re: [Templates] populating dropdown box from db

2012-05-09 Thread Mark Haney
On 05/09/2012 11:49 AM, Theunis De Klerk wrote: Hi, So does this work? [% FOREACH factory IN factory %] (Note plural in example below) I don't know if that works or not. I realized that if it did work I'd quickly get lost in the logic loop when I came back to it months from now. Not qui

Re: [Templates] populating dropdown box from db

2012-05-09 Thread Mark Haney
On 05/09/2012 11:39 AM, Octavian Rasnita wrote: Hi, I think you want something like: Select Factory: [% FOREACH some_value IN factory %] [% some_value %] [% END %] Octavian Yeah, you're right. It didn't register at the time that I would need the [% %] tags for the value substitution

Re: [Templates] populating dropdown box from db

2012-05-09 Thread Theunis De Klerk
On 5/9/2012 4:43 PM, Mark Haney wrote: in the HTML template: [% FOREACH factory IN factory %] Select Factory: $factory Is this the proper way to do this, or is there a better/more flexible way? Am I missing something? Hi, So does this work? [% FOREACH factory IN factory %] (Note

Re: [Templates] populating dropdown box from db

2012-05-09 Thread Octavian Rasnita
From: "Mark Haney" Subject: [Templates] populating dropdown box from db HI all, I'm rather new to the TT, but so far I'm liking it's flexibility. The badger book is a great resource as well. But, I'm having an issue I can't seem to find an answer to and

[Templates] populating dropdown box from db

2012-05-09 Thread Mark Haney
HI all, I'm rather new to the TT, but so far I'm liking it's flexibility. The badger book is a great resource as well. But, I'm having an issue I can't seem to find an answer to and am hoping the list can help me. I want to populate a drop down box with data from a database. I'm pulling th