You are here: Home / Documentation / How To's / How to add Google Plus button to document actions

How to add Google Plus button to document actions

by ledwell published Mar 19, 2012 01:20 PM, last modified Aug 16, 2016 10:49 AM
Add the social media "google plus" button inside a document action.

googlePlus

This is pretty easy to do.  I pretty much just grabbed the code from the google plus bookmarklet provided for your browser located here.

Take care of the icon

  • Go to google and save the button you want to use for the google plus icon on your desktop.
  • Login to your website
  • go to the ZMI
  • navigate to: manage - portal_skins - custom
  • Upload that icon as an image to the custom folder

Deal with the code

  • go to "portal-actions" - "document-actions"
  • choose "add CMF" action
  • Title should be "googlePlus" (or what ever you want your users seeing when they mouse over the icon or if the image doesn't show for some reason)
  • URL (Expression) should be 
string:javascript:(function()%7Bvar%20w=480;var%20h=380;var%20x=Number((window.screen.width-w)/2);
var%20y=Number((window.screen.height-h)/2);
window.open('https://plusone.google.com/_/+1/confirm?hl=en&url='+encodeURIComponent(location.href)+
'&title='+encodeURIComponent(document.title),'','width='+w+',height='+h+',left='+x+',top='+y+',scrollbars=no');
%7D)();
  • Icon (Expression) should be
string:$portal_url/googlePlus-button.png
  • Permissions should be set to "view"
  • Visible should be "Checked"
 
Navigation