New versions of grok come bundled with fanstatic:<br><br><a href="http://www.fanstatic.org/en/0.11.2/index.html">http://www.fanstatic.org/en/0.11.2/index.html</a><br><a href="http://grok.zope.org/doc/community/view_generation/fanstatic_resources.html">http://grok.zope.org/doc/community/view_generation/fanstatic_resources.html</a><br>
<br>With fanstatic you'll declare some resource as "needed" in the update() method of your python code.<br><br>in resource.py:<br><br>favicon = Resource(library, 'favicon.ico')<br><br>from myapp import resource<br>
<br>class MyView (grok.view):<br> def update():<br> ...<br> resource.favicon.need()<br><br>Otherwise, If you still want to do it on the templates, your code should look like this:<br><br><link rel="shortcut icon"<br>
href="static/favicon.ico" <br> tal:attributes="href static/favicon.ico"/><br><br><br>--<br>Noe<br><br><div class="gmail_quote">2011/7/18 Paul Sephton <span dir="ltr"><<a href="mailto:prsephton@gmail.com">prsephton@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi;<br><br>I'm a bit stuck, and was hoping someone could help.<br><br>I have a product directory something like the following:<br>
<br>src/app.py<br>src/resource.py<br>src/static<br>
src/static/img1.fav<br>
src/app_templates<br>src/app_templates/<a href="http://app_macro.pt" target="_blank">app_macro.pt</a><br>src/module1/__init__.py<br>src/module1/module1.py<br>src/module1/module1_templates<br>src/module1/module1_templates/<a href="http://view-mod1.pt" target="_blank">view-mod1.pt</a><br>
<br>The main <a href="http://app_macro.pt" target="_blank">app_macro.pt</a> references static/img1.fav<br><br>The submodule view '<a href="http://view-mod1.pt" target="_blank">view-mod1.pt</a>' references the macro '<a href="http://app-macro.pt" target="_blank">app-macro.pt</a>'<br>
<br>Now, I'm doing something wrong, but grok can't seem to find img1.fav when the macro is expanded (it finds the macro itself just fine). How do I get around this without duplicating static resources in the submodule directory tree? In other words, how can a submodule share static resources from the parent directory?<br>
<br>I would be very grateful for any help!<br><br>Regards,<br><font color="#888888">Paul<br><br><br>
</font><br>_______________________________________________<br>
Grok-dev mailing list<br>
<a href="mailto:Grok-dev@zope.org">Grok-dev@zope.org</a><br>
<a href="https://mail.zope.org/mailman/listinfo/grok-dev" target="_blank">https://mail.zope.org/mailman/listinfo/grok-dev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><span style="color:rgb(255, 204, 102)">---</span><br>
<span style="color:rgb(204, 153, 51)">Noe Nieto</span><br>
NNieto Consulting Services<br>
M: <a href="mailto:nnieto@noenieto.com" target="_blank">nnieto@noenieto.com</a><br>
W: <a href="http://noenieto.com" target="_blank">http://noenieto.com</a><br>
T: <a href="https://twitter.com/#%21/tzicatl" target="_blank">@tzicatl</a><br>Li: <a href="http://www.linkedin.com/profile/view?id=84300665" target="_blank">Perfil en LinkedIn</a><br><br>