[Zope3-Users] How to get the icon for a content item.

Tom Dossis td at yoma.com.au
Wed Dec 1 10:55:48 EST 2004


Stephan Richter wrote:
>>>>>>>
>>>>>>>icon = zapi.queryView(root, 'zmi_icon', TestRequest())
>>>
>>>What is hackish about that? It is exactely what I would have done. The
>>>icon is just a view named zmi_icon.
>>
>>I meant hackish, by having to create a TestRequest.  Maybe I'm being
>>pedantic.
> 
> 
> Well, you should only need the icon when you are in a view and a view always 
> has access to the request: self.request. It does not make sense to look up 
> the icon outside of view code.

To explain why: as described in my other message, my application ui is a 
gui, not a browser - I don't have a browser view.  Even if I develop my 
own gui presentation/views I would still like to display an icon for 
"all" content. For content external to my application, I could try 
obtain the icon described in the browser directive.

-Tom


More information about the Zope3-users mailing list