<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 6.00.2800.1264" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=531144822-11112003><FONT face=Arial size=2>Hi 
All,</FONT></SPAN></DIV>
<DIV><SPAN class=531144822-11112003><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=531144822-11112003><FONT face=Arial size=2>I've come across a 
problem with getting the right context when calling a script from a page 
template.</FONT></SPAN></DIV>
<DIV><SPAN class=531144822-11112003><FONT face=Arial size=2>The scenario is as 
follows:</FONT></SPAN></DIV>
<DIV><SPAN class=531144822-11112003><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=531144822-11112003><FONT face=Arial size=2>the page 
template&nbsp;<SPAN class=156475722-11112003><FONT color=#0000ff>&nbsp;<FONT 
color=#000000>"ip_template"</FONT> &nbsp;</FONT></SPAN>in root 
folder:</FONT></SPAN></DIV>
<DIV><SPAN class=531144822-11112003><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=531144822-11112003><FONT face=Arial size=2>&lt;html 
metal:define-macro="master"&gt;</FONT></SPAN></DIV>
<DIV><SPAN class=531144822-11112003><FONT face=Arial 
size=2>............</FONT></SPAN></DIV>
<DIV><SPAN class=531144822-11112003><FONT face=Arial 
size=2>&lt;div&nbsp;metal:use-macro="here/ui_slots/relatedlinks_slot/macros/relatedLinks|default" 
/&gt;</FONT></SPAN></DIV>
<DIV><SPAN class=531144822-11112003><FONT face=Arial 
size=2>..........</FONT></SPAN></DIV>
<DIV><SPAN class=531144822-11112003><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=531144822-11112003><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=531144822-11112003><FONT face=Arial size=2>the relatedLinks 
template in ui_slots/ folder:</FONT></SPAN></DIV>
<DIV><SPAN class=531144822-11112003><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=531144822-11112003><FONT face=Arial 
size=2>...........</FONT></SPAN></DIV>
<DIV><SPAN class=531144822-11112003><FONT face=Arial 
size=2>&lt;div&nbsp;metal:define-macro="relatedLinks"<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
tal:define="rlinks here/scripts/navRelated;&gt;</FONT></SPAN></DIV>
<DIV><SPAN class=531144822-11112003><FONT face=Arial 
size=2>............</FONT></SPAN></DIV>
<DIV><SPAN class=531144822-11112003><FONT face=Arial 
size=2>&lt;/div&gt;</FONT></SPAN></DIV>
<DIV><SPAN class=531144822-11112003><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=531144822-11112003><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=531144822-11112003><FONT size=+0><FONT face=Arial size=2>the 
navRelated script in scripts/ folder:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>if hasattr(<SPAN 
class=531144822-11112003>context</SPAN>.aq_explicit, 
'subject'):<BR>&nbsp;&nbsp;&nbsp; subjects=c<SPAN 
class=531144822-11112003>ontext</SPAN>.subject</FONT></DIV>
<DIV><FONT size=+0><SPAN class=531144822-11112003></SPAN><FONT face=Arial><FONT 
size=2>/<SPAN class=531144822-11112003>* for testing purposes 
*/</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT size=+0><FONT size=+0><SPAN class=531144822-11112003></SPAN><SPAN 
class=531144822-11112003></SPAN><FONT face=Arial><FONT size=2>r<SPAN 
class=531144822-11112003>eturn context.title_or_id()</SPAN><BR><SPAN 
class=531144822-11112003></SPAN>.<SPAN 
class=531144822-11112003>........</SPAN></FONT></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=531144822-11112003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=531144822-11112003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=531144822-11112003>the page template 
calling the master macro:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=531144822-11112003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=531144822-11112003>&lt;html 
metal:use-macro="here/ip_template/macros/master"&gt;</SPAN></FONT></DIV>
<DIV><SPAN class=156475722-11112003><FONT face=Arial color=#0000ff 
size=2>.......</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=531144822-11112003>&lt;/html&gt;<BR></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=531144822-11112003></SPAN></FONT><FONT 
face=Arial size=2><SPAN class=531144822-11112003></SPAN></FONT>&nbsp;</DIV>
<DIV><SPAN class=531144822-11112003><FONT face=Arial><FONT size=2>The problem is 
I keep on getting "scripts"&nbsp;as the context id being returned instead of the 
page template.<SPAN class=156475722-11112003><FONT 
color=#0000ff>&nbsp;</FONT></SPAN></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=531144822-11112003><FONT face=Arial><FONT size=2><SPAN 
class=156475722-11112003>Any ideas on what is going on what I can do to fix 
it?</SPAN></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=531144822-11112003><FONT face=Arial><FONT size=2><SPAN 
class=156475722-11112003></SPAN></FONT></FONT></SPAN>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=156475722-11112003>Thanks,</SPAN></FONT></DIV>
<DIV></FONT></SPAN><FONT face=Arial color=#0000ff size=2><SPAN 
class=156475722-11112003><FONT 
color=#000000>kmkl</FONT>&nbsp;</SPAN></FONT></DIV></BODY></HTML>