You are here: Home / Documentation / How To's / How to change document actions from text to icons

How to change document actions from text to icons

by bayerk07 — published Jun 29, 2009 03:40 PM, last modified Aug 16, 2016 10:50 AM
How to change document action text, such as "Send this" and "Print this" to icons

To display icons instead of text for document actions, such as "Send this" and "Mail this" and "RSS" follow these steps. In the ZMI:

  • Click on portal_view_customizations
  • Edit plone.abovecontenttitle.documentactions
  • Remove this code: 
    • <a href=""  tal:attributes="href daction/url;  title daction/description"  tal:content="daction/title"> </a>
  • Replace it with this code:
    • <a href="" tal:attributes="href daction/url; title daction/description"> <img tal:condition="python: daction.get('icon')" tal:attributes="src daction/icon; alt daction/title; title daction/title"/>  <tal:action tal:condition="python: not daction.get('icon')" tal:content="daction/title"  i18n:translate="">Action name</tal:action>  </a>
  • Edit each document action, to assign an icon.  In the ZMI:
    • Click on portal_actions, then document_actions
    • Existing icons are located in portal_skins/plone_images.  They're 16 x 16 pixels.  The icon expression is:
      • string:$portal_url/print_icon.gif (or mail_icon.gif, or rss.gif, etc.)
    • If you want to substitute other icons, put them in portal_skins/custom. (Don't put them into a subfolder). The icon expression will be the same (unless you've given the image file a different name.)
    • If the script finds the icon, it displays it. Otherwise it displays the text.

 

     
    Sources for some of this: 
     
    Navigation