[Grok-dev] Static Resources
janwijbrand at gmail.com
Mon Sep 19 02:16:49 EST 2011
Paul, has Noe's answer been of help to you? Did you get your issue resolved?
On 7/19/11 17:18 , Noe Nieto wrote:
> New versions of grok come bundled with fanstatic:
> With fanstatic you'll declare some resource as "needed" in the update()
> method of your python code.
> in resource.py:
> favicon = Resource(library, 'favicon.ico')
> from myapp import resource
> class MyView (grok.view):
> def update():
> Otherwise, If you still want to do it on the templates, your code should
> look like this:
> <link rel="shortcut icon"
> tal:attributes="href static/favicon.ico"/>
> 2011/7/18 Paul Sephton <prsephton at gmail.com <mailto:prsephton at gmail.com>>
> I'm a bit stuck, and was hoping someone could help.
> I have a product directory something like the following:
> src/app_templates/app_macro.pt <http://app_macro.pt>
> src/module1/module1_templates/view-mod1.pt <http://view-mod1.pt>
> The main app_macro.pt <http://app_macro.pt> references static/img1.fav
> The submodule view 'view-mod1.pt <http://view-mod1.pt>' references
> the macro 'app-macro.pt <http://app-macro.pt>'
> 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?
> I would be very grateful for any help!
More information about the Grok-dev