[Zope-CMF] Making CMFProduct visible in folder contents

Carl Rendell cer@sol43.com
Sun, 26 May 2002 09:15:19 -0700


I've run into similar problems, but the issue for me has involved 
the icon for the product.

When I reviewed the folder_contents page template or dtml method I 
found that the condition to be met for presentation is a return 
from getIcon, or in dtml _.getattr(obj, 'icon', '')

If the return is false, the item will not be displayed. Here are 
the code snippets -

DTML

         <dtml-if icon>
          <a href="&dtml.url_quote-getId;&dtml-methodID;"
           ><img src="&dtml-portal_url;/&dtml-icon;"
                 alt="&dtml-Type;" border="0"></a>
          </dtml-if>

ZPT

          <span tal:condition="icon">
          <a href=""
		    tal:attributes="href python: items.getId() + '/' + methodID">
	     <img src="" alt="" border="0"
		      tal:attributes="src python: here.portal_url() + '/' + icon;
			                  alt items/Type|nothing"></a>
		 </span>

Once I get a return from the getIcon call. The items show up.

~C

> From: "Kevin Carlson" <khcarlso@bellsouth.net>
> To: "Pawel Lewicki" <lewicki@provider.pl>,
> 	<zope-cmf@zope.org>
> Subject: RE: [Zope-CMF] Making CMFProduct visible in folder contents
> Date: Sat, 25 May 2002 14:54:56 -0400
>
> I had something like this happen to me when I created my first 
> CMF-based
> product.  Turns out that the pages that render views of the folders are
> looking for specific meta-types -- you have to alter the code to 
> make your
> product instance display.
>
> -----Original Message-----
> From: zope-cmf-admin@zope.org [mailto:zope-cmf-admin@zope.org]On 
> Behalf Of
> Pawel Lewicki
> Sent: Friday, May 24, 2002 4:30 PM
> To: zope-cmf@zope.org
> Subject: [Zope-CMF] Making CMFProduct visible in folder contents
>
>
> Hi,
> I created my own product based on CMFBoringProduct, but I've got one
> problem. I can't see created instance while listing the content of the
> folder. What did I wrong? Everything else seems to be fine. It's 
> registered
> in portal_types with predefined actions, etc.
>
> Pawel Lewicki
>

Carl E. Rendell
Solution43
Information Distribution Consulting        |   "Ahhhh the power of
cer@sol43.com                              |    acquisition"  - Chef Z