[Zope] ZPT changing javascript (HOW?) - Easy with DTML

Pedro Beck Gomes da Costa pbeck@ciberbit.pt
Wed, 2 Oct 2002 11:29:11 +0100


This is a multi-part message in MIME format.

------=_NextPart_000_001E_01C26A06.EDE6D030
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi!

I recently decided to change all my coding from dtml to page templates, =
but I now have a problem i cant solve.
I need to change the javascript on html script blocks. A quick example =
in DTML of what i want to do and that works perfectly:

<HTML>
<HEAD>
<TITLE>Chat</TITLE>
<SCRIPT type=3D"text/javascript">
 function connect()
 {
  username =3D <dtml-var "USER_NAME">;
  password =3D <dtml-var "USER_NAME">;
  server =3D <dtml-var "USER_NAME">;
  port =3D <dtml-var "USER_NAME">;
  subRoomID =3D <dtml-var "USER_NAME">;
  groupID =3D <dtml-var "USER_NAME">;

   WBChat.Connect2(server,port,subRoomID,username,password,groupID);
 }=20
</SCRIPT>

</HEAD>

<BODY>
<!-- BODY HERE -->
</BODY>
</HTML>

Someone can help me on how to di this with ZPT??

Thanks in advance,

Pedro Costa

------=_NextPart_000_001E_01C26A06.EDE6D030
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 6.00.2719.2200" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I recently decided to change all my =
coding from=20
dtml to page templates, but I now have a problem i cant =
solve.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I need to change the javascript on html =
script=20
blocks. A quick example in DTML of what i want to do and that works=20
perfectly:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2>&lt;HTML&gt;<BR>&lt;HEAD&gt;<BR>&lt;TITLE&gt;Chat&lt;/TITLE&gt;<=
/FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&lt;SCRIPT=20
type=3D"text/javascript"&gt;<BR>&nbsp;function =
connect()<BR>&nbsp;{<BR>&nbsp;=20
username =3D &lt;dtml-var "USER_NAME"&gt;;<BR>&nbsp; password =3D =
&lt;dtml-var=20
"USER_NAME"&gt;;<BR>&nbsp; server =3D &lt;dtml-var =
"USER_NAME"&gt;;<BR>&nbsp; port=20
=3D &lt;dtml-var "USER_NAME"&gt;;<BR>&nbsp; subRoomID =3D &lt;dtml-var=20
"USER_NAME"&gt;;<BR>&nbsp; groupID =3D &lt;dtml-var =
"USER_NAME"&gt;;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;=20
WBChat.Connect2(server,port,subRoomID,username,password,groupID);<BR>&nbs=
p;}=20
<BR>&lt;/SCRIPT&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&lt;/HEAD&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&lt;BODY&gt;<BR>&lt;!-- BODY HERE=20
--&gt;<BR>&lt;/BODY&gt;<BR>&lt;/HTML&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Someone can help me on how to di this =
with=20
ZPT??</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks in advance,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Pedro Costa</FONT></DIV></BODY></HTML>

------=_NextPart_000_001E_01C26A06.EDE6D030--