Hello, YY><TMPL_DEF NAME="NAME" VALUE="value">
ST>I don't like this. Mixing display logic with setup of variables is a ST>very dangerous thing. KS>I don't even know what this is really useful for? If you are hard coding KS>the definition of a variable in your template, why can't you just hard KS>code that variable where you use it? I hacked in support for exactly this functionality using a filter, so let me explain why you can't do that. Pretend you have a header.tmpl that has several different tabs on it, where one is highlighted and the others are not highlighted. It is easiest to write this as a single HTML::Template template and have a bunch of <TMPL_IF>s based on a <TMPL_VAR>. That <TMPL_VAR>, say it's called "where", says where you are (like "aboutus" or "companynews" or whatever) in the site. Now, many templates include header.tmpl. The HTML::Template model encourages HTML designers to be separate from coders. Say the site layout changes, like, the tabs get changed around. About us and company news go under the same tab which is called "Company Buzz" or something. A whole lot of HTML needs to be rewritten, but all the backend scripts are the same. Without being able to set a value in a template, you have to change backend scripts to enact this change, even though nothing in those templates needs to change. If there is a customer feedback script called feedback.cgi, your CGI programmer needs to care about the site layout and design to pass in a variable. You will run into similar problems all the time if you design your app using an MVC style. Does this help shed some light on why this functionality is desireable? Humbly, Andrew ---------------------------------------------------------------------- Andrew Ho http://www.tellme.com/ [EMAIL PROTECTED] Engineer [EMAIL PROTECTED] Voice 650-930-9062 Tellme Networks, Inc. 1-800-555-TELL Fax 650-930-9101 ---------------------------------------------------------------------- ------------------------------------------------------- This sf.net email is sponsored by: Dice - The leading online job board for high-tech professionals. Search and apply for tech jobs today! http://seeker.dice.com/seeker.epl?rel_code=31 _______________________________________________ Html-template-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/html-template-users
