[ZPT] PageTemplates here != PythonScripts context ???????

Ulrich Eck ueck@net-labs.de
Sat, 14 Jul 2001 17:55:21 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_003F_01C10C8E.26CF6560
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

while skinning CMF with FSPageTemplates and PythonScripts I found out
that there must be major difference between=20

FSPageTemplate's "here" and PythonScript's "context" ..
as well as
FSPageTemplate's "container" and PythonScript's "container"

There was a discussion about naming them equally some time ago
which doesn't matter to me .. but the should BE the same i think.

short example for you to check:

- create a Product that exports FileSystemBased skins for CMF
- create a subfolder in the skins folder
- put a PageTemplate and a PythonScript in the skin's root
- put another PageTemplate into the subfolder

CMFSkinProduct
  |-__init__.py
  |-skins
    |-roottemplate.pt
    |-rootscript.py
    |-subfolder
      |-foldertemplate.pt

roottemplate.pt:
<html>
  <body>
   <div tal:replace=3D"structure container/subfolder/foldertemplate"/>
  </body>
<html>

rootscript.py:
##title=3D a test script
return container.subfolder.foldertemplate()

foldertemplate.pt
<h1> this is foldertemplate </h1>

there is no problem when you call the roottemplate .. it will show the =
headline ..
the PythonScript will raise an error NotFound ...

This is mainly influenced by the DynamicType that a PortalContent/Folder =
is derived
from and that enables the skinning of it ..

shouln't PyhtonScripts and PageTemplates container be the same ?????

I had the same experiences with here!=3Dcontext ... when putting a =
pythonscript vs. pagetemplate
into the skins-folder and use acquisition e.g. =
/cmfroot/Members/myname/roottemplate ..
then here in pagetemplate seems to be cmfroot and context in =
pythonscripts is myname ...

any tips how to get around this ??

Ulrich Eck
net-labs


------=_NextPart_000_003F_01C10C8E.26CF6560
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4134.600" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>while skinning CMF with FSPageTemplates =
and=20
PythonScripts I found out</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>that there must be major difference =
between=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>FSPageTemplate's "here" and =
PythonScript's=20
"context" ..</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>as well as</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>FSPageTemplate's "container"=20
and&nbsp;PythonScript's "container"</FONT></DIV></FONT><FONT =
face=3DArial=20
size=3D2></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>There was a discussion about naming =
them equally=20
some time ago</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>which doesn't matter to me .. but the=20
should&nbsp;BE the same i think.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>short example for you to =
check:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>- create a Product that exports =
FileSystemBased=20
skins for CMF</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>- create&nbsp;a subfolder in the skins=20
folder</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>- put a PageTemplate and a PythonScript =
in the=20
skin's root</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>- put another PageTemplate into the=20
subfolder</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>CMFSkinProduct</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; |-__init__.py</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; |-skins</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; &nbsp; =
|-roottemplate.pt</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; &nbsp; =
|-rootscript.py</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; &nbsp; |-subfolder</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; &nbsp;&nbsp;&nbsp;=20
|-foldertemplate.pt</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>roottemplate.pt:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&lt;html&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; &lt;body&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp; &lt;div =
tal:replace=3D"structure=20
container/subfolder/foldertemplate"/&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; &lt;/body&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&lt;html&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>rootscript.py:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>##title=3D a test script</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>return=20
container.subfolder.foldertemplate()</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>foldertemplate.pt</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&lt;h1&gt; this is foldertemplate=20
&lt;/h1&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>there is no problem when you call the =
roottemplate=20
.. it will show the headline ..</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>the PythonScript will raise an error =
NotFound=20
...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>This is mainly influenced by the =
DynamicType that a=20
PortalContent/Folder is derived</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>from and that enables the skinning of =
it=20
..</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>shouln't PyhtonScripts and =
PageTemplates container=20
be the same ?????</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I had the same experiences with =
here!=3Dcontext ...=20
when putting a pythonscript vs. pagetemplate</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>into the skins-folder and use =
acquisition e.g.=20
/cmfroot/Members/myname/roottemplate ..</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>then here in pagetemplate seems to be =
cmfroot=20
and&nbsp;context in pythonscripts is myname ...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>any tips how to get around this =
??</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Ulrich Eck</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>net-labs</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_003F_01C10C8E.26CF6560--