Getting rid of that annoying drag and drop text on the Note Board

By Michael Doyle posted 07-01-2011 17:03

  

On the Tag profile page (and other places where the Note Board exists) you get this text

Right click or drag and drop this link to your browser's favorites or bookmarks toolbar to tag external sites.

With some other text around it. The issue is that the drag and drop thing doesn’t work most of the time and it has some cross browser issues. In any case you ought to be able to change it. On other pages this seems to be fairly straight forward with some JavaScript but with the Tag Profile page (tagprofile.aspx) it is troublesome to change (to say the least). I had to resort to using code that was fired with a mouse over. This is due to the fact the page words are written after the page loads (so the _spBodyOnLoadFunctionNames function wouldn’t work).

So to make it work. Follow these steps.

  1. Locate the tagprofile.aspx page (in the SharePoint hive) and make a copy.
  2. Open up the tagprofile.aspx page in your editor (I use notepad).
  3. Somewhere inside an asp:Content page you will need to place this javascript.

    <script type="text/javascript">
    var iCount=0;
    oSel = document.getElementById("ctl00_m_g_9c94936f_0411_4436_9fb5_fe5b49403d1b_ctl00_PlaceHolder");
    function HideComments()
    {
     if(iCount==0)
    {
    s = oSel.innerHTML;
    var j = s.indexOf("bookmarks toolbar");
     if(j > 0)
     {
      iCount = 1;
       oSel.innerHTML="There are no notes posted yet. You can use notes to comment on a page,
    document, or external site. When you create notes they will appear here and <a href=http://ordevsps01:5555/_layouts/thoughts.aspx>under your profile</a> for easy retrieval. Other people can also view the notes you post.<br /> <br /><a href=javascript:var%20d=document,l=d.location,e=encodeURIComponent,du=''http:
  4. \u002f\u002fordevsps01:5555\u002f_layouts\u002fSocialDataFrame.aspx'',u=du+''?title='+e(d.title)+'&Src=bm'+'&DisplayUrl='+e(l.href)+'&Url='+e(l.href);if (typeof(OpenTagDialog)=='function'){OpenTagDialog(du);}else{if(!window.open

  5. (u,null,''toolbar=0,status=0,resizable=0,scrollbars=1,width=650,height=400'')){l.href=u;}}void(0);>Right click this link and add to your browser's favorites or bookmarks toolbar to tag external sites.</a><br />";
     }
    }
    }
    window.document.body.onmouseover = HideComments;
    </script>
  6. You will need to replace ctl00_m_g_9c94936f_0411_4436_9fb5_fe5b49403d1b_ctl00_PlaceHolder with the one that is appropriate for your page. Just search the tagprofile.aspx page for anything with PlaceHolder on it ( you will need to view it in the browser and view source).
  7. The innerHTML above is just an example (it removes the drag and drop reference and the last paragraph), but you can put in whatever text you want.
  8. Save and test.

If there is an easier way to modify this I would be glad for somebody to let me know what it is. But for the time being this works and you can put whatever text you want in there. The only issue is that if they refresh the page without the mouse being over the text then it will show the old text until the mouse is over the page. So the users might see a blip of the old text. Using innerHTML should avoid most browser issues.



#noteboard #sharepoint #social #SharePoint
0 comments
137 views