<div dir="ltr">Hi all,<br>Can anybody tell me how can i add resource by using <a href="http://z3c.pt">z3c.pt</a>. i know how to add it by using zope.pagetemplate, i tried it and it was working well. The following is the code i am working with and it was not working with <a href="http://z3c.pt">z3c.pt</a><br>
<br><br><b><u>configure.zcml:-<br><br></u>.<br>.<br></b>&lt;adapter<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; factory=&quot;.resizing_font.form_template&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for=&quot;.resizing_font.ResizingFont&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name=&quot;tatr_css_js.form&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /&gt;&nbsp;&nbsp;&nbsp;<b> <br><br>&nbsp;</b>&lt;browser:resourceDirectory<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; name=&quot;tatr_js&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; directory=&quot;tatr_resource_js&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; /&gt;&nbsp; <b><br><br>.<br>.<br>.<br><br><br><u><a href="http://resizing_font.pt">resizing_font.pt</a> :-<br>
<br></u></b>&lt;html&gt;<b><u><br></u></b>&nbsp;&nbsp;&nbsp;&nbsp; &lt;head&gt;<br>&nbsp; &nbsp; &nbsp;&nbsp; &lt;script type=&quot;text/javascript&quot; src=&quot;jquery-1.2.6.js&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tal:attributes=&quot;src context/++resource++tatr_js/jquery-1.2.6.js&quot;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <br>
&nbsp; &nbsp; &nbsp;&nbsp; &lt;/script&gt;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/head&gt;<br>&nbsp;&nbsp; &lt;body&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This is a test :)<br>&nbsp;&nbsp; &lt;/body&gt;<br><br>&lt;/html&gt;<b><u><br><br><br><br>resizing_font.py :-<br><br></u></b>from z3c.pt.pagetemplate import ViewPageTemplateFile<b><u><br>
<br></u></b>class ResizingFont(FormBase):&nbsp;&nbsp;  <br>&nbsp;&nbsp;&nbsp; template = NamedTemplate(&#39;tatr_css_js.form&#39;)&nbsp; <br>&nbsp;&nbsp;&nbsp; form_fields=[] &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; def __init__(self,context,request):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.request=request&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.context=context<br>form_template = NamedTemplateImplementation(<br>&nbsp;&nbsp;&nbsp; ViewPageTemplateFile(&#39;<a href="http://resizing_font.pt">resizing_font.pt</a>&#39;))<br><br><br><b>While running with this code i am getting the error&nbsp;&nbsp; <br>
<br></b>2008-10-14T06:14:36 ERROR SiteError <a href="http://192.168.0.43:8080/resizing_font.html">http://192.168.0.43:8080/resizing_font.html</a><br>Traceback (most recent call last):<br>&nbsp; File &quot;/home/z3.4/lib/python/zope/publisher/publish.py&quot;, line 133, in publish<br>
&nbsp;&nbsp;&nbsp; result = publication.callObject(request, obj)<br>&nbsp; File &quot;/home/z3.4/lib/python/zope/app/publication/zopepublication.py&quot;, line 167, in callObject<br>&nbsp;&nbsp;&nbsp; return mapply(ob, request.getPositionalArguments(), request)<br>
&nbsp; File &quot;/home/z3.4/lib/python/zope/publisher/publish.py&quot;, line 108, in mapply<br>&nbsp;&nbsp;&nbsp; return debug_call(obj, args)<br>&nbsp;&nbsp; - __traceback_info__: &lt;security proxied zope.app.publisher.browser.viewmeta.ResizingFont instance at 0x98deeac&gt;<br>
&nbsp; File &quot;/home/z3.4/lib/python/zope/publisher/publish.py&quot;, line 114, in debug_call<br>&nbsp;&nbsp;&nbsp; return obj(*args)<br>&nbsp; File &quot;/home/z3.4/lib/python/zope/formlib/form.py&quot;, line 774, in __call__<br>&nbsp;&nbsp;&nbsp; return self.render()<br>
&nbsp; File &quot;/home/z3.4/lib/python/zope/formlib/form.py&quot;, line 768, in render<br>&nbsp;&nbsp;&nbsp; self.form_result = self.template()<br>&nbsp; File &quot;/home/z3.4/lib/python/z3c/pt/pagetemplate.py&quot;, line 40, in render<br>&nbsp;&nbsp;&nbsp; return template.render(**parameters)<br>
&nbsp; File &quot;/home/z3.4/lib/python/chameleon/zpt/template.py&quot;, line 51, in render<br>&nbsp;&nbsp;&nbsp; return super(PageTemplateFile, self).render(**kwargs)<br>&nbsp; File &quot;/home/z3.4/lib/python/chameleon/core/template.py&quot;, line 156, in render<br>
&nbsp;&nbsp;&nbsp; return super(TemplateFile, self).render(**kwargs)<br>&nbsp; File &quot;/home/z3.4/lib/python/chameleon/core/template.py&quot;, line 62, in render<br>&nbsp;&nbsp;&nbsp; template = self.cook_check(parameters=kwargs)<br>&nbsp; File &quot;/home/z3.4/lib/python/chameleon/core/template.py&quot;, line 152, in cook_check<br>
&nbsp;&nbsp;&nbsp; return Template.cook_check(self, **kwargs)<br>&nbsp; File &quot;/home/z3.4/lib/python/chameleon/core/template.py&quot;, line 57, in cook_check<br>&nbsp;&nbsp;&nbsp; template = self.cook(parameters=parameters, **kwargs)<br>&nbsp; File &quot;/home/z3.4/lib/python/chameleon/core/template.py&quot;, line 138, in cook<br>
&nbsp;&nbsp;&nbsp; template = self.compiler(**kwargs)<br>&nbsp; File &quot;/home/z3.4/lib/python/chameleon/core/translation.py&quot;, line 597, in __call__<br>&nbsp;&nbsp;&nbsp; self.root.start(stream)<br>&nbsp; File &quot;/home/z3.4/lib/python/chameleon/core/translation.py&quot;, line 438, in start&nbsp;&nbsp;&nbsp; self.node.visit()<br>
&nbsp; File &quot;/home/z3.4/lib/python/chameleon/core/translation.py&quot;, line 107, in visit&nbsp;&nbsp;&nbsp; self.body()<br>&nbsp; File &quot;/home/z3.4/lib/python/chameleon/core/translation.py&quot;, line 92, in body<br>&nbsp;&nbsp;&nbsp; element.node.visit()<br>
&nbsp; File &quot;/home/z3.4/lib/python/chameleon/core/translation.py&quot;, line 107, in visit&nbsp;&nbsp;&nbsp; self.body()<br>&nbsp; File &quot;/home/z3.4/lib/python/chameleon/core/translation.py&quot;, line 92, in body<br>&nbsp;&nbsp;&nbsp; element.node.visit()<br>
&nbsp; File &quot;/home/z3.4/lib/python/chameleon/core/translation.py&quot;, line 107, in visit&nbsp;&nbsp;&nbsp; self.body()<br>&nbsp; File &quot;/home/z3.4/lib/python/chameleon/core/translation.py&quot;, line 92, in body<br>&nbsp;&nbsp;&nbsp; element.node.visit()<br>
&nbsp; File &quot;/home/z3.4/lib/python/chameleon/core/translation.py&quot;, line 106, in visit&nbsp;&nbsp;&nbsp; self.begin()<br>&nbsp; File &quot;/home/z3.4/lib/python/chameleon/core/translation.py&quot;, line 72, in begin<br>&nbsp;&nbsp;&nbsp; self.stream.begin(self.serialize())<br>
&nbsp; File &quot;/home/z3.4/lib/python/chameleon/core/translation.py&quot;, line 174, in serialize<br>&nbsp;&nbsp;&nbsp; dynamic_attrs = self.dynamic_attributes or ()<br>&nbsp; File &quot;/home/z3.4/lib/python/chameleon/zpt/language.py&quot;, line 74, in dynamic_attributes<br>
&nbsp;&nbsp;&nbsp; if self.element.tal_attributes is not None:<br>&nbsp; File &quot;/home/z3.4/lib/python/chameleon/core/utils.py&quot;, line 52, in get<br>&nbsp;&nbsp;&nbsp; return f(value)<br>&nbsp; File &quot;/home/z3.4/lib/python/chameleon/zpt/expressions.py&quot;, line 236, in definitions<br>
&nbsp;&nbsp;&nbsp; raise e<br>SyntaxError: Not a valid path-expression.<br><a href="http://192.168.0.43">192.168.0.43</a> - - [14/Oct/2008:06:14:36 +0000] &quot;GET /resizing_font.html HTTP/1.1&quot; 500 84 &quot;<a href="http://192.168.0.43:8080/">http://192.168.0.43:8080/</a>&quot; &quot;Mozilla/5.0 (X11; U; Linux i686; en-US; rv:<a href="http://1.8.1.16">1.8.1.16</a>) Gecko/20080702 Iceweasel/<a href="http://2.0.0.16">2.0.0.16</a> (Debian-2.0.0.16-0etch1)&quot;<br>
<br><br>Thanks in advance :)<br><b><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br></b><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br></div>