[Zope3-dev] resource names

Garrett Smith garrett@mojave-corp.com
Sat, 3 May 2003 17:22:35 -0500


I'm wanting to store my images in an "img" subdirectory, underneath the
directory where my templates and CSS files are stored. The causes
trouble for resource refs within the style sheets. E.g.

.foo td {
  background-image: url('img/bar.gif')
}

will fail when used in templates -- 'img' in 'img/bar.gif' is treated as
the resource name.

This problem doesn't show up in page templates since resource names are
explicitly declared. E.g.

  <img src=3D"img/bar.gif" tal:attributes=3D"src context/@@/bar.gif" />

The obvious solution is to store everything in the same directory, which
is what I'll end up doing.

But couldn't resources break with tradition and use the entire remaining
path as the resource name? E.g. I could declare a resource as:

  <browser:resource=20
    name=3D"img/bar.gif"
    image=3D"www/img/bar.gif" />

and reference it using "/@@/img/bar.gif".

 -- Garrett