Puneet Kishor wrote:
I know that you don't mean to state that in an absolute sort of way,

No, I am just explaining the way things work (or don't work) for me, but TMTOWTDI :)


because I disagree. I also include headers/footers, and code title and bunch of other things in the headers and footers. Most of the time the title of the page is dynamic precisely because it describes dynamic contents of a page. The designer should not worry about what the title is... the designer should only worry about how the <title> should look.

I try to give the template designers the freedom to change as much of the text that is displayed to the user that is possible. Since the template designer is already building the content part of this particular dynamic page, they should realize what would be an appropriate title for the page based on that what they are building. I believe that if a designer has an issue with the way something is worded, then they should not have to ask a programmer to change it. That is why we have templates...


I even go to the extent of allowing the designers to choose error messages for the users if they wish. When an error condition occurs (invalid form fields or something like that), I provide descriptive error keys with a default message that the designer can override if they choose:

<TMPL_IF errors>
<span style="color: red">
<TMPL_IF email_invalid>The email address you provided does not look valid<br /></TMPL_IF>
<TMPL_IF address_missing>You are required to fill out the address field<br /></TMPL_IF>
</span>
</TMPL_IF>


I feel this gives more power to the designers without needing to make things any more complex.

Another benefit of placing as much text as possible in the templates is localization. Translation can occur at the template level instead of needing to translate the text provided by the code and then also translating the text in the template...

Keep it simple. That is why it is fast. That is why it works. That is why it is easy to understand. And that is why we like it here over other blahblah templating systems...

Simplicity and speed are the 2 most important strengths of HTML::Template in my opinion, and I wouldn't want to interfere with those goals. But complexity in the templates is added by the programmer, not by the module itself. A new feature in the module does not automatically transfer into a more complex template or more complex code... In many cases a new feature can simplify both code and template (the TMPL_ELSIF is an example where it can simplify the template in certain circumstances))


I admire Sam for his persistence in keeping things simple, and eliminating the feature creep that has damaged many other projects. But, I am often finding myself doing things that I don't like, just to get around some of the constraints of the template language.

Anyway, I am nowhere near annoyed enough to ditch HTML::Template. It is still in my top 10 most used modules and it will keep its place for the forseeable future...

Cheers,

Cees



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users

Reply via email to