[Zope] Feature request for metal - default macros?

Chris Withers chrisw@nipltd.com
Sat, 10 Aug 2002 11:40:06 +0100


KevinL wrote:
> 
> Quick question:  Is there a good way to set a "default" macro?  What I'm
> trying to do is setup a situation where we call:
> 
> here/blah/skins/helpfile/macros/?language

> Where ?language resolves to the current language in use.  What I want to
> do is say "if the language selected doesn't exist, use english" - or,
> from the macro side, "if the macro specified does not exist, use this
> macro instead".
> 
> Is that doable easily?  

make language a python script:

language = "a string containing your language, got from wherever you get 
it from"
if context.skins.helpfile.macros.has_key(language):
    return language
else:
    reutnr 'english'

cheers,

Chris