Skip to content

nan

Sections
Personal tools
You are here: Home » How Tos » How to add Icons to the Portal Tabs   portaltabs1
Log in
No Software Patents!

Under the influence of the patent system and big industry lobbyists, the European Union is on the verge of making a huge mistake: to pass a law that would legalize software patents.

 

How to add Icons to the Portal Tabs

Document Actions
This actually can be done using CSS only. This Version modifies the global_sections.pt

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

HowToAddIconsToThePersonalBar

How to add a News Folder


comments:

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 ...

Created by nan
Last modified 2004-12-15 05:30 PM
« November 2009 »
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30          
 
 

Powered by Plone

This site conforms to the following standards: