setuphandler cleanup
[zope-bootstrap.git] / src / koehsel.theme / koehsel / theme / browser / images / README.txt
1 README for the 'browser/images/' directory
2 ==========================================
3
4 This folder is a Zope 3 Resource Directory acting as a repository for images.
5
6 Its declaration is located in 'browser/configure.zcml':
7
8     <!-- Resource directory for images -->
9     <browser:resourceDirectory
10         name="koehsel.theme.images"
11         directory="images"
12         layer=".interfaces.IThemeSpecific"
13         />
14
15 An image placed in this directory (e.g. 'logo.png') can be accessed from
16 this relative URL:
17
18     "++resource++koehsel.theme.images/logo.png"
19
20 Note that it might be better to register each of these resources separately if
21 you want them to be overridable from zcml directives.
22
23 The only way to override a resource in a resource directory is to override the
24 entire directory (all elements have to be copied over).
25
26 A Zope 3 browser resource declared like this in 'browser/configure.zcml':
27
28     <browser:resource
29         name="logo.png"
30         file="images/logo.png"
31         layer=".interfaces.IThemeSpecific"
32         />
33
34 can be accessed from this relative URL:
35
36     "++resource++logo.png"
37
38 Notes
39 -----
40
41 * Whatever the way they are declared (in bulk inside a resource directory or
42   as separate resources), images registered as Zope 3 browser resources don't
43   have all the attributes that Zope 2 image objects have (i.e. the 'title'
44   property and the 'tag()' and 'get_size()' methods).
45   This means that if you want the html tag of your image to be auto-generated
46   (this is the case by default for the portal logo), you should store it in a
47   directory that is located in the 'skins/' folder of your package, registered
48   as a File System Directory View in the 'portal_skins' tool, and added to the
49   layers of your skin.
50
51 * Customizing/overriding images that are originally accessed from the
52   'portal_skins' tool (e.g. Plone default logo and icons) can be done inside
53   that tool only. There is no known way to do it with Zope 3 browser
54   resources.
55   Vice versa, there is no known (easy) way to override a Zope 3 browser
56   resource from a skin layer in 'portal_skins'.