[Zope-CMF] A little nit in my python based content type - can't get icon to render.

Grégoire Weber gregoire.weber@switzerland.org
Fri, 16 Aug 2002 10:48:35 +0200


Hi Jeffrey,

Where did you put the 'site_icon.gif'?

Put your icons in skins/doc_control folder:

Directory structure in Products folder:
  - CMFDocControl
    - skins (folder)
      - doc_control (folder, appears in portal_skins skins folder)
        - site_icon.gif
    - Extensions (folder)
    - __init__.py

and register the folders as file system directories in the __init__.py:

  # Make the skins available as DirectoryViews
  registerDirectory('skins', globals())
  registerDirectory('skins/doc_control', globals())

then take the Install.py from the Extension directory of CMFArticle and 
adapt it to your needs. Have a look at the lines starting with '# Setup the skins'.

General hint:

Have a look at a existing type (like CMFArticle which has folderish behaviour)
an strip it down before adding your functionality.

Greg

At 23:20 15.08.2002 -0500, Jeffrey Franks wrote:
>Hi,
>
>I'm working on my 1st python based CMF Product.
>
>The 'icon' parameter of factory_type_information is not rendering. This=
 should
>be a no brainer (sigh).
>The code I'm using is very similar to the various CMF Products and CMF=
 itself.
>
>I'm using utils.ContentInit in __init__.py to access new content class from=
 portal_type
>tool. I've used this to replace the explicit registerClass implementation
>because I didn't think both were needed. True?
>
>BTW: registerClass had    icon = "images/site_icon.gif" rendered just=
 fine.
>
>The fti defined in the DocSite class starts like this:
>
>factory_type_information = (
>    { 'id'             : 'Document Control Site',
>      'meta_type'      : 'Document Control Site',
>      'description'    : """\
>      Document Control Sites wrap document control objects \
>      and work flow policy.""",
>      'icon'           : 'site_icon.gif',
>      'product'        : 'CMFDocControl',
>      'factory'        : 'addDocSite',
>      .... snip ....
>
>I've registered the directory that the gifs are located in as
>
>     registerDirectory('images', globals())
>
>Everything works except the icon for this CMF content_type does not
>render (it shows up as a broken icon).
>
>What am I missing ?
>
>Might it have something to do with the Extensions/Install.py
>which I have not implemented? And, what are these additional
>installs seen in some CMF Products?
>
>
>-- jlf
>
>_______________________________________________
>Zope-CMF maillist  -  Zope-CMF@zope.org
>http://lists.zope.org/mailman/listinfo/zope-cmf
>
>See http://collector.zope.org/CMF for bug reports and feature requests 

_____________________________________
Grégoire Weber
mailto:gregoire.weber@switzerland.org