[Zope-CMF] CMF 2.2.0-alpha: getIcon

yuppie y.2009 at wcm-solutions.de
Mon Nov 16 12:24:17 EST 2009


Hi!


CMF 2.2.0-alpha has some getIcon changes based on what I proposed here:
https://mail.zope.org/pipermail/zope-cmf/2009-January/028059.html

Unfortunately the issue is more complicated than I thought and some 
things are now broken in CMF 2.2.0-alpha: The return values of getIcon() 
and icon() are not backwards compatible, breaking e.g. the ZMI icons if 
REQUEST['BASEPATH1'] exists.


There are 4 ways to specify icons:


1.) absolute URL:
-----------------

"http://www.example.org/zope_instance/cmf_instance/icons/foo.png"

CMF 2.1:         -
CMF 2.2.0-alpha: getIcon(), icon()


2.) URL relative to REQUEST['BASEPATH1']:
-----------------------------------------

"cmf_instance/icons/foo.png"

CMF 2.1:         getIcon(), icon()
CMF 2.2.0-alpha: -


3.) URL relative to portal:
---------------------------

"icons/foo.png"

CMF 2.1:         getIcon(relative_to_portal=1), icon(1)
CMF 2.2.0-alpha: -


4.) icon id:
------------

"foo.png"

CMF 2.1:         -
CMF 2.2.0-alpha: getIcon(relative_to_portal=1), icon(1)


Proposal
--------

In CMF we always need the absolute URL. Since getIcon() and icon() 
already have a different meaning and something like 
getIcon(absolute=True) looks too complicated for the default, I propose 
to add a new method: getIconURL()

getIcon() and icon() should get the same behavior as they had in CMF 2.1.


Any thoughts?

Cheers,

	Yuppie



More information about the Zope-CMF mailing list