[Zope-CVS] CVS: Products/PageDesign - PageDesign.py:1.2

Shane Hathaway shane@cvs.zope.org
Mon, 1 Jul 2002 14:27:32 -0400


Update of /cvs-repository/Products/PageDesign
In directory cvs.zope.org:/tmp/cvs-serv29800

Modified Files:
	PageDesign.py 
Log Message:
Targets can either be mixed into elements or be rendered as independent page
blocks.  It's hard to say which is right, so for now, it's a switchable
global flag.


=== Products/PageDesign/PageDesign.py 1.1.1.1 => 1.2 ===
 change_page_designs = 'Change Page Designs'
 
+# Constant until the right policy can be chosen.
+INDEPENDENT_TARGETS = 1
+
 
 _www = os.path.join(os.path.dirname(__file__), 'www')
 
@@ -303,8 +306,14 @@
                 # Make sure it's a string or unicode.
                 s = '%s' % s
                 if editable:
-                    s = (self.target_html % (name, index)) + (
-                        self.element_html % (name, index, s))
+                    # Wrap the element.
+                    s = self.element_html % (name, index, s)
+                    if INDEPENDENT_TARGETS:
+                        # Make targets independent blocks.
+                        res.append(self.target_html % (name, index))
+                    else:
+                        # Targets are mixed into elements.
+                        s = (self.target_html % (name, index)) + s
                 res.append(s)
         if editable:
             # Add a final insertion point.