{ "info": { "author": "UNKNOWN", "author_email": "UNKNOWN", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Zope3", "License :: OSI Approved :: Zope Public License", "Programming Language :: Python" ], "description": "MEGROK PAGELET\r\n==============\r\n\r\nThis package try to bring the functionality of z3c.template and\r\nz3c.pagelet to grok.\r\n \r\nz3c.template gives us a alternative for the zpt:metal layout based system in grok.\r\nThe z3c.pagelet has the advantage that it\u00b4s possible to register layouts with\r\nhelp of\r\nthe zope-component-architecuture this allows us to change or modify layouts \r\nwithout touching the *master* macro.\r\n\r\nThis means you have megrok.pagelet.Layout component which holds\r\nthe layout. Instead of using grok.View you have to take \r\nmegrok.pagelet.Pagelet for normal BrowserViews.\r\n\r\nIf you need more information about z3c.template please look here [1].\r\n\r\nThe Layout\r\n----------\r\n\r\nThe first thing we have to do is set up a layout for our pagelet.\r\n\r\nclass MyLayout(megrok.pagelet.Layout):\r\n grok.context()\r\n grok.layer()\r\n\r\n megrok.pagelet.template('my_layout_template.pt')\r\n\r\nThis configures the template ('my_layout_template.pt') as a layout for the given\r\ncontext and layer. Of course it\u00b4s possible to specify different \r\nlayouts for different layers or contexts.\r\n\r\n\r\nIn the content of my_layout_template.pt is something like this:\r\n\r\n\r\n
\r\n