[Zope3-dev] resource names

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


Actually, as a more straight forward approach, what about adding a
"resourcedir" directive (or similar) that would just serve resources
from a local directory? This would save a lot of ZCML resource
declarations.

 -- Garrett

Garrett Smith wrote:
> 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.
>=20
> .foo td {
>   background-image: url('img/bar.gif')
> }
>=20
> will fail when used in templates -- 'img' in 'img/bar.gif' is treated
> as the resource name.
>=20
> This problem doesn't show up in page templates since resource names
> are explicitly declared. E.g.
>=20
>   <img src=3D"img/bar.gif" tal:attributes=3D"src context/@@/bar.gif" =
/>
>=20
> The obvious solution is to store everything in the same directory,
> which is what I'll end up doing.
>=20
> 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:=20
>=20
>   <browser:resource
>     name=3D"img/bar.gif"
>     image=3D"www/img/bar.gif" />
>=20
> and reference it using "/@@/img/bar.gif".
>=20
>  -- Garrett
>=20
>=20
> _______________________________________________
> Zope3-dev mailing list
> Zope3-dev@zope.org
> http://mail.zope.org/mailman/listinfo/zope3-dev