Sam Tregar writes:
>On 17 Jan 2002, William R Ward wrote:
>
>> That's a violation of the principle of separating HTML from code.
>> What if the HTML designer decides to use a radio button group instead
>> of a popup?
>
>Actually, I'd say that HTML is a violation of the principle of separating
>design from programming.  There's no clear separation between the
>programmatic elements of the <form> tags and the layout of the <form>
>tags.  You'll have to draw the line somewhere - clearly the designer can't
>be entirely in charge of form creation.

Why not?  Most decent UI designers know how to set up list-boxes,
checkboxes, radios, etc. as needed.  It's not rocket science.  But
asking them to make a change to some Perl code is not reasonable.

>I've found that in most cases the content of list-boxes is part of the
>programming of a web app.  If there is styling to be done then it's
>usually just a matter of adding a css class attribute.

Well, my experience differs.  In my experience, the UI designer makes
a mockup which includes dummy form elements but has the look that they
want.  I would then go through and convert the mockup into a template
for them (mainly because <tmpl_loop> gives HTML people headaches).
Then they can carry forward making changes to the template.

>It's a balancing act and you have to weigh the pros and cons on each side.
>It is certainly possible to produce a <select> element entirely inside the
>template.  What you end up with is a rat's nest of loops and conditionals.
>Alternately you can give up a certain amount of flexibility in return for
>vastly simplifying your templates.  I generally choose the latter.

Just about every HTML::Template app I've worked on has been a rat's
nest of loops and conditionals, but that's pretty much unavoidable I
think.  For example, look at this page: http://airtel.cellmania.com/
Personally I can't stand the color scheme, but that's the customer's
prerogative.  The HTML structure is based on a template with several
nested loops, and a correspondingly complex Perl function to structure
the data accordingly.  There's just no way to make a template for that
page that isn't a rat's nest.

When you've already got stuff like that, complicated loops and
conditionals for a <select> tag is nothing.

The advantage of all this is that you can have different versions of
the site (http://m1.cellmania.com/ or http://orange.cellmania.com/ are
more examples of this) that use the same Perl code with different
templates to fit the desired look & feel.  One customer might want a
drop-down list, while another might want a list of radio buttons.  If
you do all the HTML in the template, you can make both of them happy
with the same Perl code driving it.

--Bill.

-- 
William R Ward            [EMAIL PROTECTED]          http://www.wards.net/~bill/
-----------------------------------------------------------------------------
     If you're not part of the solution, you're part of the precipitate.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to