Welcome to EMC Consulting Blogs Sign in | Join | Help

Matt Lally's Blog

Breaking Up SharePoint 2010 Social Tags

If you ever need to break up the “Tags and  Notes” and “I Like It” links on a SharePoint 2010 Master Page rendered by the GlobalSiteLink3 usercontrol, you could replace the reference on your master page with the following JavaScript and HTML.  I reflected the dll which renders these global links to find that it was simply rendering the JavaScript

 
<asp:Content ContentPlaceholderID="PlaceHolderMain" runat="server">
<script type="text/javascript">
function SendTag() {
SafeRunFunction(function () { 
TagDialogOpener.Open(encodeURI(window.location), document.title, '0'); },'SocialData.js', 'TagDialogOpener');
}
function GetQuickTag() {
SafeRunFunction(function () { var o = new SocialQuickTag('<%#this.ClientID %>'); o.url = encodeURI(window.location); o.title = 
document.title; o.tagged_text = 'Tagged this page with \u0027I Like It.\u0027'; o.failure_text = 'Failed tagging this page.'; o.replaceImg_style = 'border:0; 
left:-0px !important;top:-332px !important;position:absolute;'; o.AddQuickTag(0); }, 'SocialData.js', 'SocialQuickTag');
}
<script>
<td class="s4-socialdata-notif">
<div class="ms-socialNotif-Container">
<span class="ms-socialNotif-groupSeparator"></span>
<a class="ms-socialNotif" id="GetQuickTag" href="BLOCKED SCRIPT ;" 
onclick="GetQuickTag();" title="Tags this page with &#39;I Like It.&#39; 
Tags make it easy to remember links and post items to your news feed." >
<span>
<span 
style="height:32px;width:32px;position:relative;display:inline-block;overflow:hidden;">
<img style="border:0; left:-0px !important;top:-132px 
!important;position:absolute;" id="GetQuickTagImg" alt="Tags this page with 
&#39;I Like It.&#39; Tags make it easy to remember links and post items 
to your news feed." src="/_layouts/images/mossfgimg.png"/>
</span>
<span class="ms-socialNotif-text">I Like It</span>
</span>
</a>
<a class="ms-socialNotif" id="TagsAndNotes" href="BLOCKED SCRIPT ;" 
onclick="SendTag();" onmouseover="GetSocialNotification();" title="Tags help you 
remember links and classify the page. Notes are public comments. Tags and notes 
post to your news feed and work across different sites." >
<span>
<span 
style="height:32px;width:32px;position:relative;display:inline-block;overflow:hidden;">
<img style="border:0; left:-0px !important;top:-300px 
!important;position:absolute;" id="TagsAndNotesImg" alt="Tags help you remember 
links and classify the page. Notes are public comments. Tags and notes post to 
your news feed and work across different sites." 
src="/_layouts/images/mossfgimg.png"/>
</span>
<span class="ms-socialNotif-text">Tags</span>
</span>
</a>
</div>
</td>
Published Friday, September 30, 2011 3:55 PM by matt.lally

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Veena said:

i tried the above code but am getting the below error:

An error occurred during the processing of /_catalogs/masterpage/TestImage.aspx. Code blocks are not allowed in this file.

March 5, 2012 8:06 AM
 

matt.lally said:

Do you have any other scripts on this page?

March 5, 2012 2:43 PM
 

Leia said:

Thanks so much! I needed this.

(Where exactly did you find the globalsitelink in which dll?)

May 14, 2012 11:33 AM
 

Mor Shemesh said:

June 13, 2012 2:30 PM
 

Frank said:

Hi Matt,

what's the original javascript?  what I need is not to break those links. I need to rebuild those two buttons on my page since they are blocked on the masterpage which I can not touch...

so I think is it possible to use the original script from sharepoint to rebuild the two buttons...  any idea will be big help to me, thanks!

Frank Wang

July 11, 2012 9:12 PM
 

Velin Georgiev said:

That helped! Thank you!

April 16, 2013 9:44 AM

Leave a Comment

(required) 
(optional)
(required) 
Submit
Powered by Community Server (Personal Edition), by Telligent Systems