[Checkins] SVN: Sandbox/cklinger/megrok.pagelet/trunk/ preparing release 0.1

Christian Klinger cklinger at novareto.de
Tue Mar 24 04:33:05 EDT 2009


Log message for revision 98328:
  preparing release 0.1

Changed:
  U   Sandbox/cklinger/megrok.pagelet/trunk/CHANGES.txt
  U   Sandbox/cklinger/megrok.pagelet/trunk/README.txt
  U   Sandbox/cklinger/megrok.pagelet/trunk/setup.py

-=-
Modified: Sandbox/cklinger/megrok.pagelet/trunk/CHANGES.txt
===================================================================
--- Sandbox/cklinger/megrok.pagelet/trunk/CHANGES.txt	2009-03-24 08:30:27 UTC (rev 98327)
+++ Sandbox/cklinger/megrok.pagelet/trunk/CHANGES.txt	2009-03-24 08:33:05 UTC (rev 98328)
@@ -1 +1,10 @@
-01 TEST
+trunk (2009-03-24)
+==================
+
+  - xxx [Ingeniweb]
+
+0.1 (2009-03-24)
+------------------
+
+Initial release as egg.
+

Modified: Sandbox/cklinger/megrok.pagelet/trunk/README.txt
===================================================================
--- Sandbox/cklinger/megrok.pagelet/trunk/README.txt	2009-03-24 08:30:27 UTC (rev 98327)
+++ Sandbox/cklinger/megrok.pagelet/trunk/README.txt	2009-03-24 08:33:05 UTC (rev 98328)
@@ -1,2 +1,66 @@
 MEGROK PAGELET
 ==============
+
+This package try to bring the functionality of z3c.template and
+z3c.pagelet to grok.
+ 
+z3c.template gives us a alternative for the zpt:metal layout based system in grok.
+The z3c.pagelet has the advantage that it´s possible to register layouts with help of
+the zope-component-architecuture this allows us to change or modify layouts 
+without touching the *master* macro.
+
+This means you have megrok.pagelet.Layout component which holds
+the layout. Instead of using grok.View you have to take 
+megrok.pagelet.Pagelet for normal BrowserViews.
+
+If you need more information about z3c.template please look here [1].
+
+The Layout
+----------
+
+The first thing we have to do is set up a layout for our pagelet.
+
+class MyLayout(megrok.pagelet.Layout):
+    grok.context()
+    grok.layer()
+
+    megrok.pagelet.template('my_layout_template.pt')
+
+This configures the template ('my_layout_template.pt') as a layout for the given
+context and layer. Of course it´s possible to specify different 
+layouts for different layers or contexts.
+
+
+In the content of my_layout_template.pt is something like this:
+
+<html>
+ <body>
+   <div class="layout" tal:content="structure view/render">
+         here comes the content
+   </div>
+ </body>
+</html>
+
+The Pagelt (View)
+-----------------
+
+Ok instead of using the common grok.View for our BrowserViews we use now
+megrok.pagelet.Paglet. This component has one difference to a normal
+grok.View. This difference is in the __call__ method of the megrok.pagelet.Pagelet.
+This means that the  __call__ method of a  Pagelet does not only return the renderd 
+"template" of the Pagelet. The __call__ first search for the layout in given context
+and layer and  then it renders the "template" in this layout.
+
+class View(megrok.pagelet.Pagelet)
+    grok.context()
+    grok.layer()
+    grok.name()
+
+    def render(self)
+	return "..."
+
+
+Now if you point your browser on .../view you sould see the renderd view in the
+given layout.
+
+[1] http://pypi.python.org/pypi/z3c.template/1.1.0

Modified: Sandbox/cklinger/megrok.pagelet/trunk/setup.py
===================================================================
--- Sandbox/cklinger/megrok.pagelet/trunk/setup.py	2009-03-24 08:30:27 UTC (rev 98327)
+++ Sandbox/cklinger/megrok.pagelet/trunk/setup.py	2009-03-24 08:33:05 UTC (rev 98328)
@@ -6,7 +6,7 @@
 
 setup(name='megrok.pagelet',
       version='0.1',
-      description="Grok extension to configure z3c.pagelets",
+      description="z3c.template / z3c.layout support for Grok",
       long_description=long_description,
       # Get more strings from http://www.python.org/pypi?%3Aaction=list_classifiers
       classifiers=['Programming Language :: Python',
@@ -27,7 +27,6 @@
       install_requires=[
           'setuptools',
           'martian',
-	  'interlude',
           'grokcore.component',
 	  'z3c.template',
           'grok',  # just for the ViewGrokker



More information about the Checkins mailing list