Re: [Cheetahtemplate-discuss] "Existence" "bug"
Brought to you by:
rtyler,
tavis_rudd
From: Ian B. <ia...@co...> - 2001-09-17 15:12:04
|
Quick hack: add a catchall object to the searchList, like: class QuickHack: def __getattr__(self, attr): return None Chuck Esterbrook <Chu...@ya...> wrote: > I didn't realize this one was still around: > #if $foo > $foo > #end if > > If '$foo' doesn't exist at all, this causes an exception. I think there was > a recommended work around, but I forget what it was and don't see it in the > manual. > > I tried: > #if $hasName('foo') > > But that doesn't work. I really need a solution for this. My template > writers use #include "header.html" everywhere which has: > > #if $keywords > <META name="keywords" content="${keywords}"> > #end if > > But not all published objects in the system come with $keywords. > > Suggestions? > > > -Chuck > > > _______________________________________________ > Cheetahtemplate-discuss mailing list > Che...@li... > https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss > |