Sam Tregar writes:
>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?

Can someone who understands the caching code help with this?

>> 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...

Well I've done that too, but then you have to add several lines to
your Perl code, where adding one line to a Template would be easier.
Also it means that adding another UI element (another file) would
require adding more to the Perl code.

--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