locked
How to remove hyperlink from sharepoint calendar web part event

    Question

  • Hello ,

    I want to learn that how to remove hyperlink from sharepoint calendar item on default view ...When I create an item to sharepoint calendar list.Item is shown as an hyperlink on default view and I cannot find any result .I want to show event only text base not with hyperlink...This seem very easy case but I cannot find.Sharepoint allows only change shown field on  default view.Please replay this question if you have any information...

    Thanks...

     

    • Edited by Mike Walsh FIN Friday, January 7, 2011 6:41 PM NEVER add a set of trailing ... to Titles
    Friday, January 7, 2011 5:30 PM

Answers

  • I don't know of anything in the API that would let you suppress the hyperlink of a calendar list item.  The only way I can think of would be to add some JavaScript to the page to remove the links. Do you want to remove all links or just selected links?

    If you want to remove all links for a view:  (this works for the Month view and would have to modified a bit for the Week and Day views)

    1. Go the the Monthly view of the calendar
    2. Click Site Actions, Edit Page
    3. Add a Content Editor Web Part
    4. Move the new web part below the calendar web part
    5. Edit the web part and use the Source Editor button to add the following JavaScript
    6. Save your changes and test

     

    <script>
    
    var tables = document.getElementsByTagName("TABLE");
    for (var i=0;i<tables.length;i++)
    {
    
     if (tables[i].summary == "Monthly graphical Calendar View")
     {
    
      var TDs = tables[i].getElementsByTagName("TD");
      for (var j=0;j<TDs.length;j++)
      {
    
       if (TDs[j].className=="ms-cal-monthitem")
       {
        var As = TDs[j].getElementsByTagName("A");
        if (As.length>0)
        {
         TDs[j].innerText = As[0].innerText;
        }
    
       }
    
      }
      break;
     }
    
    }
    
    </script>
    
    


    Mike Smith TechTrainingNotes.blogspot.com
    • Marked as answer by KeFang Chen Friday, January 14, 2011 8:37 AM
    Sunday, January 9, 2011 7:40 PM