An acquisition-oriented question. If I have a top level directory containing HTML stuff and page templates, I usually like to keep all the images in an Images subdirectory, just for neatness, like so: Top-level-folder Images In one site, I want to have a folder per different look-and-feel, thus: Top-level-folder Images LookAndFeel1 LookAndFeel2 ...so acquisition helps me by allowing me to override specific files by putting them in a LookAndFeel folder; lots of default stuff is acquired from the Top-level-folder. This of course, includes the Images folder - if I refer to LookAndFeel1/Images, all works because Images is acquired. However, the contents of Images aren't overrideable - hence: if Top-level-folder/Images contains logo.jpg and example.jpg and I decide to override logo for LookAndFeel1 by creating its own Images and putting logo.jpg in there, as: Top-level-folder Images logo.jpg example.jpg LookAndFeel1 Images logo.jpg ...then acqusition works fine for references to /LookAndFeel1/Images/logo.jpg, but reference to LookAndFeel1/Images/example.jpg fail. I understand why; acquisition works by containment, so Images can be acquired because it exists in a container found on the way up the hierarchy, but once an Images is found, that's yer lot. Okay, I understand the behaviour - how would Zope gurus do this differently to let acquisition work for me? ben
Quoting "Ben Last (Zope)" <zope@benlast.com>:
An acquisition-oriented question.
--snip--
However, the contents of Images aren't overrideable - hence: if Top-level-folder/Images contains logo.jpg and example.jpg and I decide to override logo for LookAndFeel1 by creating its own Images and putting logo.jpg in there, as: Top-level-folder Images logo.jpg example.jpg LookAndFeel1 Images logo.jpg ...then acqusition works fine for references to /LookAndFeel1/Images/logo.jpg, but reference to LookAndFeel1/Images/example.jpg fail.
--snip--
Okay, I understand the behaviour - how would Zope gurus do this differently to let acquisition work for me?
I am far away from being a Zope guru :). However I would like to share my idea. Instead of creating an Images folder in every customization folder, create customization folders in your top-level Images folder. So your directory layout would be like this: Top-level-folder Images logo.jpg example.jpg LookAndFeel1 logo.jpg Then reference your images with statments like: Images/LookAndFeel1/logo.jpg and Images/LookAndFeel1/example.jpg. Works? right? :) Cheers, Mohsen,
Hi Ben Another way: /images/logo.gif /site.folder.org /site.folder.org/images/logo.gif Templates in /site.folder.org with <img tal:content="structure here/images/logo.gif" /> will get the overridden logo. A more longterm way may be to investigate the CMF's skinning mechanisms or http://www.dieter.handshake.de/pyprojects/zope/#bct_sec_2.4 -- Jean Jordaan http://www.upfrontsystems.co.za /training <-- Zope/Plone training! /training/af <-- Nie af nie, Afrikaans.
Jean Jordaan wrote:
A more longterm way may be to investigate the CMF's skinning mechanisms or http://www.dieter.handshake.de/pyprojects/zope/#bct_sec_2.4
I think Kapil's also taken a shot at "skins tool outside of CMF", then there's also Zope 3's FS Synch stuff... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
participants (4)
-
Ben Last (Zope) -
Chris Withers -
Jean Jordaan -
Mohsen Moeeni