> From: "Sam Tregar" <[EMAIL PROTECTED]>
> Are you saying you can't do this now?  I've produced <select> boxes
> with HTML::Template.  It requires a nasty pile of <tmpl_if> logic but
> it's doable.

Hi Sam. Yes, I think "tmpl_if" will work. The problem I have is that my
templates will be organized by spoken language. The english ones in a "en"
directory. Spanish in "es" directory. My script will determine which
templates to access depending on the visitor's language preference.

Now, in a template I might have an option box for "male or female". In
Spanish, "hombre or mujer." This language difference is kept in the
template, and an ordinal is used to communicate to the scripts what the
choice was. Regardless of language, "1" is a male, and "2" is a female. So,
in this case, it would defeat the strength of templates to call some other
device to emit the option box. I'd have to store the language text in a
MySQL table and pass it to the device that will create the option box. I'd
rather not do that since the text logically belongs in the template instance
for that language.

So, yes, I could set a param name for "one" and "two" and "three". Which
ever is set to boolean true, that would be the option line to get the
"selected" attribute. But, that seems like a difficult way to do it. The
conditional test for string value (in template::expression) would be easier.
I could set a single param to "two" and in the template test for "one" or
"two" or "three". One param name with different values. It just seemed like
template::expression gave me *a lot* more things which, at this point, I
agree are undesireable.

Now that I think about it, I believe I could set a param name for "one" and
"two" and "three" but instead of making them true and false (and using an if
statement) I could set the correct one to "selected" and just let each
variable be replaced by its value. Only one would have "selected" and it
would be emitted at the correct option line.

Do you know if it would be more efficient to set one var and use a
conditional to determine which option select line to treat differently. Or,
set many vars and let them all be replaced (to null except one).

Thanks,
Mark



-------------------------------------------------------
This SF.net email sponsored by: Enterprise Linux Forum Conference & Expo
The Event For Linux Datacenter Solutions & Strategies in The Enterprise 
Linux in the Boardroom; in the Front Office; & in the Server Room 
http://www.enterpriselinuxforum.com
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users

Reply via email to