[Grok-dev] Static Resources

Noe Nieto nnieto at noenieto.com
Tue Jul 19 11:18:10 EDT 2011

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>

> Hi;
> I'm a bit stuck, and was hoping someone could help.
> I have a product directory something like the following:
> src/app.py
> src/resource.py
> src/static
> src/static/img1.fav
> src/app_templates
> src/app_templates/app_macro.pt
> src/module1/__init__.py
> src/module1/module1.py
> src/module1/module1_templates
> src/module1/module1_templates/view-mod1.pt
> The main app_macro.pt references static/img1.fav
> The submodule view 'view-mod1.pt' references the macro '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!
> Regards,
> Paul
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> https://mail.zope.org/mailman/listinfo/grok-dev

Noe Nieto
NNieto Consulting Services
M: nnieto at noenieto.com
W: http://noenieto.com
T:  @tzicatl <https://twitter.com/#%21/tzicatl>
Li: Perfil en LinkedIn <http://www.linkedin.com/profile/view?id=84300665>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/grok-dev/attachments/20110719/53ac9cbe/attachment.html 

More information about the Grok-dev mailing list