[Zope] Sharing images between different sites

Cliff Ford Cliff.Ford at ed.ac.uk
Thu Nov 18 02:26:45 EST 2004


In addition to previous comments:

In dtml you could do it like this:

<dtml-var expr="restrictedTraverse('/images/logo').tag()">

In a page template this works:

<div tal:content="structure container/images/logo" tal:omit-tag=""></div>

Cliff

Cliff Ford wrote:
> Your page template should have a plain text img tag:
> 
> <img src="/images/logo" width=xxx height=yyy alt="caption">
> 
> The page itself should render even if /images/logo does not exist, and 
> there would be no traceback.
> 
> Cliff
> 
> John Poltorak wrote:
> 
>> On Wed, Nov 17, 2004 at 03:04:25PM -0600, J Cameron Cooper wrote:
>>
>>> John Poltorak wrote:
>>>
>>>> Is there any way to set up an images folder which can be shared 
>>>> between several sites under one zope instance?
>>>>
>>>> If so how would I reference them if they were all in the /images 
>>>> folder?
>>>
>>>
>>> Very basic acquisition design. Put the 'images' folder in the site 
>>> root.  It will be available everywhere by acquisition. Refer to it as 
>>> relative to wherever you are.
>>
>>
>>
>> Does it also work in Plone sites?
>>
>> I tried to include an image from '/images' in the 'left_slot'. Ended 
>> up with this:-
>>
>>     *  Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__
>>       __traceback_info__: path(pathexpr)
>>     * Module Python expression "path(pathexpr)", line 1, in <expression>
>>     * Module Products.PageTemplates.PythonExpr, line 81, in __call__
>>     * Module Products.PageTemplates.Expressions, line 201, in __call__
>>     * Module Products.PageTemplates.Expressions, line 189, in _eval
>>     * Module Products.PageTemplates.Expressions, line 145, in _eval
>>       __traceback_info__:
>>     * Module Products.PageTemplates.Expressions, line 347, in 
>> restrictedTraverse
>>       __traceback_info__: {'path': ['images', 'logo'], 
>> 'TraversalRequestNameStack': ['logo']}
>>
>> KeyError: 'images' (Also, an error occurred while attempting to render 
>> the standard error message.)
>>
>>
>> In my left_slots definition I have:-
>>
>> /images/logo
>>
>> What am I doing wrong?
>>
>>  
>>
>>>         --jcc
>>>
>>
>>
>>
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope-dev )


More information about the Zope mailing list