[Product-Developers] Re: Registering a viewlet for a given content type?

Wichert Akkerman wichert at wiggy.net
Wed Feb 3 16:23:54 UTC 2010


On 2/3/10 16:46 , Mikko Ohtamaa wrote:
>
>
> Shane Graber wrote:
>>
>> In looking through the viewlet registration zcml, a person can show a
>> viewlet based on if the current context is IContentish or IFolderish.
>> However, I have not seen an example of showing a viewlet for only a
>> certain
>> content type.  Is this possible through some zcml configuration?  I have a
>> couple of viewlets that I want to only show up if viewing a Page/Document.
>> Do I have to register the viewlet based on IContentish and then within the
>> viewlet code itself test whether or not the current content type is ==
>> "Document"?
>>
>
> http://www.starzel.de/blog/how-to-get-a-different-look-for-some-pages-of-a-plone-site
>
> All content types should have content type specific marker interfaces.

Why? Marker interfaces are often not needed. Such blanket statements are 
almost never true.

Wichert.




More information about the Product-Developers mailing list