Skip to content

nan

Sections
Personal tools
You are here: Home » How Tos » How to add Icons to the personal bar   personalbar
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 personal bar

Document Actions
The Personal Bar is the bar you see on top of this page in between the tabs and the breadcrumbs. Per default the icon is the linkOpaque.gif wich is IMHO quite dull.

The place where this is defined is plone.css. To get rid of the linkOpaque.gif you have to customize your 'ploneCustom.css':

  #portal-personaltools li {
background: transparent;
padding-left: 8px;
color: &dtml-globalFontColor;;
margin-left: 1em;
display: inline;
}

To insert an custom icon for your actions you have to customize the global_personalbar like this:

  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
i18n:domain="plone">
<body>
<!-- THE PERSONAL BAR DEFINITION -->
<div metal:define-macro="personal_bar"
tal:define="display_actions python:user_actions[:-1]+global_actions+user_actions[-1:];"
tal:omit-tag="">

<h5 class="hiddenStructure" i18n:translate="heading_personal_tools">Personal tools</h5>
<ul id="portal-personaltools">
<li class="portalUser"
tal:condition="not: isAnon"><a
id="user-name"
tal:omit-tag="not: mtool/getHomeFolder"
tal:attributes="href string:${mtool/getHomeUrl}"
accesskey="accesskeys-personalbar"
i18n:attributes="accesskey">
<span class="visualCaseSensitive"
tal:replace="user/getUserName">
John
</span>
</a></li>
<li class="portalNotLoggedIn" tal:condition="isAnon"
i18n:translate="you_are_not_logged_in">
You are not logged in
</li>
<tal:actions tal:repeat="action python:here.getOrderedUserActions(keyed_actions=keyed_actions)">
<li>
<a href=""
tal:attributes="href action/url"
accesskey="accesskeys-personalbar"
i18n:attributes="accesskey">
<img alt="" src=""
tal:define="actionid action/id;
icon python:aitool.renderActionIcon('personalBar_actions', actionid, None);"
tal:condition="icon"
tal:replace="structure icon" />
<tal:actionname i18n:translate="" tal:content="action/name">dummy</tal:actionname>
</a>
</li>
</tal:actions>

</ul>
</div>

next you have to Goto portal_actionicons in the ZMI and add icons for the actions:

personalBar_actions mystuff My Stuff 0 mystuff_acticon.png

personalBar_actions join Join 0 join.png

personalBar_actions login login 0 login.png

personalBar_actions logout logout 0 logout.png

personalBar_actions mytrashcan mytrashcan 0 mytrashcan.png

personalBar_actions plone_setup mytrashcan 0 mytrashcan.png

personalBar_actions preferences preferences 0 preferences.png

personalBar_actions undo undo 0 undo.png

thats all. Enjoy your personal Personal Bar.

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 maenner-club.de (plone 2)

Related

How to add Icons to the Portal Tabs

[More HowTos by nan]?


comments:

this can be done with css only --eaon, Wed, 02 Jun 2004 17:41:31 -0500 reply
you can use the ids to apply the icons via css, like we did it for the user icons - why do you put custom markup there?

this can be done with css only --nan, Thu, 03 Jun 2004 10:57:55 -0500 reply
I have to modify the code anyway to add ids. so same difference. This way I can access the icons via ZMI - actionicons, for me the logical place to store the icons for actions or am I doing a fundamental mistake here? But of course: point taken.

wonderful --paulbhartzog, Tue, 17 Aug 2004 16:46:12 -0500 reply
just have to say this rox. -paul

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: