Zope and Frames (was Re: [Zope] ZPT and CSS)

Tino Wildenhain tino at wildenhain.de
Thu Dec 4 11:58:06 EST 2003


Hi Andre,

Andre Meyer schrieb:
> Hi again
> 
> As Tino says, this is not about frames per se, but in a <frameset> you
> need to specify the framed pages. Therefore you need a reference and
> that should be done in the __init__.py.
> Or is there another possibility? Of course, the need to specify all
> references to pages and images in __init__.py is not convenient,
> particularly when you already have a database and need to recreate an
> instance of your product. (btw this applies to a filesystem-based
> approach).
> 
> ========================================================================
> Here is what I have in my __init__.py:
> 
> __doc__ = """Music Library initialisation module"""
> __version__ = '0.1'
> 
> import mlib
> import Piece
> import Composer
> from ImageFile import ImageFile
> from Products.PageTemplates.PageTemplateFile import PageTemplateFile
> 
> misc_ = {
> 	'mlib.css':ImageFile('zpt/mlib.css', globals()),
> 	'mlibPrint.css':ImageFile('zpt/mlibPrint.css', globals()),
> 	'index_top':ImageFile('zpt/index_top.zpt', globals()),
> 	'index_bottom':PageTemplateFile('zpt/index_bottom', globals()),
> 	}
> 
> def initialize(context):
> ...

Of course you dont make your ZPT pages attributes of the misc_
resource!
See how the other products handle it!
They become class attributes (rather methods!)
and are therefore accessible in the context of
the instance. This has to be so because I
think you will have some display in it to
refer to something related to the actual
instance you are working on.

Redesign your product this way and I believe it
will work as expected.

Regards
Tino Wildenhain





More information about the Zope mailing list