Customizing Navigation Icons
For Plone 2.1
- Create the following "Script (Python)" objects in "plone_skins/custom"
getIconStyleBlob
try:
name="customIcon_"+item['path'].replace("/","")
icon=context.restrictedTraverse(item['path']).customIcon
return """
."""+name+""" a {
background-image: url(http://www.adaptix.co.za/adaptix/"""+icon+""");
background-repeat: no-repeat;
background-position: 0% 3px;
}
"""
except:
return ""
getIconStyleName
style="contenttype-"+context.plone_utils.normalizeString(item['portal_type'])
try:
if (hasattr(context.restrictedTraverse(item['path']),'customIcon')):
style="customIcon_"+item['path'].replace("/","")
except:
None
return style
***************
*** 6,14 ****
<tal:level define="level options/level|python:0;
! item_type_class python: 'contenttype-' + here.plone_utils.normalizeString(item['portal_type']);
item_wf_state_class python: 'state-' + here.plone_utils.normalizeString(item['review_state']);
isNaviTree options/isNaviTree | nothing;
">
<div tal:attributes="class item_type_class">
<a tal:condition="item/currentItem"
--- 6,18 ----
<tal:level define="level options/level|python:0;
! item_type_class python: here.getIconStyleName(item);
item_wf_state_class python: 'state-' + here.plone_utils.normalizeString(item['review_state']);
isNaviTree options/isNaviTree | nothing;
">
+
+
+ <style type="text/css" tal:content="python: here.getIconStyleBlob(item)"/>
+
<div tal:attributes="class item_type_class">
<a tal:condition="item/currentItem"
). See "portal_skins/plone_images" for built-in icons, or add your own to "portal_skins/custom"For Plone 2.0
- Customize "portal_skins/custom/portlet_navigation" as below:
< tal:attributes="src string:${here/portal_url}/${sibling/getIcon};
---
> tal:attributes="src string:${here/portal_url}/${sibling/getCustomIcon};
if (hasattr(context.aq_explicit,'customIcon')):
return context.customIcon
else:
return context.getIcon()
). See "portal_skins/plone_images" for built-in icons, or add your own to "portal_skins/custom"Please contact me at graeme@raspberry.co.za if you have additional comments or suggestions. For support, please use the Plone forums.

Author: