How to add Icons to the Portal Tabs
To add Icons to your tabs you have to customize the global_sections.pt
like this:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
i18n:domain="plone">
<body>
<!-- THE SECTION TABS DEFINITION -->
<div metal:define-macro="portal_tabs"
tal:omit-tag=""
tal:define="selected_tabs python:here.selectedTabs(template_id, here);
selected_portal_tab selected_tabs/portal;"
tal:condition="portal_tabs">
<h5 class="hiddenStructure" i18n:translate="heading_sections">Sections</h5>
<ul id="portal-globalnav">
<tal:tabs tal:repeat="tab portal_tabs">
<li tal:attributes="id string:portaltab-${tab/id};
class python:test(selected_portal_tab==tab['id'], 'selected', 'plain');">
<a href="" class="" tal:attributes="href tab/url;"
accesskey="accesskeys-tabs" i18n:attributes="accesskey" >
<img alt="" src=""
tal:define="actionid tab/id;
icon python:aitool.renderActionIcon('portalTabs_actions', actionid, None);"
tal:condition="icon"
tal:replace="structure icon" />
<tal:block omit-tag="" i18n:translate="">
<span tal:replace="tab/name">Tab Name</span>
</tal:block>
</a>
</li>
</tal:tabs>
</ul>
</div>
</body>
</html>
Add the Icons you want to display to your portal_actionicons in the ZMI:
portalTabs_actions news News 0 news.png
portalTabs_actions Members Members 0 members.png
portalTabs_actions complete_login_history Login History 0 login.png
portalTabs_actions index_html Home 0 home.png
portalTabs_actions sitemap Sitemap 0 sitemap.png
Thats it. Your Portaltabs will now display your newly defined icons.
See how it looks like on www.trashpicts.com (well actually there you see an older version of this on plone 1 -- this recipes only works on Plone 2 -- but it looks the same anyway)
or on maenner-club.de (plone 2)
Related Readings
icons in plone 1 --dachterberg, Thu, 10 Jun 2004 00:19:37 -0500 reply
You mentioned an older version of this for plone 1. Since I have a
plone 1 site on objectis.org, could you post instructions for how you
did this on your trashpicts.com site?
icons in plone 1 --nan, Fri, 11 Jun 2004 08:00:11 -0500 reply
As Plone 1 does not have the portal_actionicons you will have to hardcode the iconname in the header.pt:
<metal:block tal:repeat="tab portal_tabs">
<a href="" class=""
tal:attributes="href tab/url;
class python:test(selected_portal_tab==tab['id'], 'selected', 'plain')">
<img src="tab.png"
border="0"
alt=""
tal:attributes="src string:${tab/name}_acticon.png" />
<span tal:omit-tag="" i18n:translate="">
<span tal:replace="tab/name">dummy</span></span>
</a>
</metal:block>
then you have to add the icons to your custom skin like Home_acticon.png, news_acticon.png ...
