On Mon, 31 Dec 2001, William R. Ward wrote: > I would like to propose a new feature: die_on_bad_includes. If set to > 0, then the <tmpl_include> statement does not require the file to > actually exist. The attached patch implements this functionality, but > I haven't tested it with caching, and suspect it may have problems > there. Since I have no experience using the caching features I > figured it would be safer to not try to patch that area.
This seems like a reasonable addition to me. I'd accept a patch that included appropriate modifications to the caching code and some test cases. Any objections? > Why would anyone want this? Maybe a case study will make it clear. I > have a website where some of the pages are drawn by a Perl module that > I wrote. This module uses HTML::Template to display these pages. But > in some parts of the site there is a disclaimer to be added to the > bottom of the page, and not in others. At first I satisfied this need > by having a blank disclaimer in the directory at the end of the search > path, and this can be overridden by putting the disclaimer in a > directory earlier in the path if it was needed. However I soon > realized that I would need to do the same for several other files as > well, and I didn't want a bunch of blank files in the directory that > is at the end of the path. So I modified HTML::Template to take care > of it for me, and the results are attached: I'd probably solve this problem by handling the include in the code and then doing: <tmpl_var disclaimer> in the template. Over time I've tended to use <tmpl_include> less and less. Maybe that means the feature needs upgrading but I'm not sure... -sam --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
