Enhancement to the Announcements List View Web part 

Tags: SharePoint Development

Announcements in SharePoint are used all over and are a very popular way to communicate updates to your end users. However, I've never been too fond of the out of box look and feel for the announcements that come when you first create a site. So, I created this neat DataFormWebPart that presents the announcements in a more streamlined fashion.

Out of box look and feel:

 

Customized Look and Feel:

 

Feature Details:

  • The "See Associated Attachments(s)" link only shows if there is an attachment for that announcement.
  • If an announcement is expired, they will not display in this view.
  • The view only shows the title and body columns. Changing the names of those columns will break the web part.
  • The web part supports rich text.

 

Installation Instructions

  1. Right click and "save target as" to download the web part definition file.
  2. After you have downloaded it, open the web part file with notepad.
  3. Search the contents for "id='{"

    Figure 1: search results

    This is the GUID that the DataFormWebPart is using to read out the list items from the announcements list. You'll need to replace this GUID with the GUID from your announcements list or you'll break the page.

  4. To retrieve your GUID, go to "View All Site Content", click on your announcements list, and click "List Settings". You'll see the GUID in the URL:

    Figure 2: URL showing what appears to be a GUID

  5. Remove the "%7B" and "%7D" off the ends, then replace all the instances of "%2D" with dashes. Take that string and replace what is in the { } in the web part file:

    Figure 3: URL after removing/replacing characters

    Figure 4: The web part file showing the updated GUID

     

  6. Save the web part file, then edit the page you want to place it on and import in onto the page (add web parts -> advanced -> browse, import -> browse to web part file on c drive -> upload -> drag and drop onto page).

    Note: if you get an error when you drop the web part onto the page that say "List not found", you entered or did not update the GUID in the web part file correctly.
 
Posted by Phillip S. Wicklund on 2-May-08
5  Comments  |  Trackback Url  | 0  Link to this post | Bookmark this post with:        
 
Failed to render control: Value does not fall within the expected range.

Comments


Ulrich Bernskovcommented onThursday, 19-Jun-2008
Thank you for sharing your code. Is there a way to trim the number of lines returned from Body? Like the "..."


Phil Wicklundcommented onMonday, 23-Jun-2008
Hey Ulrich - I'm not sure how to do that... you'll have to tweak the XSL somehow to trim the data.. Look for the @body variable.


Martin Spaldingcommented onFriday, 29-Aug-2008
Hi! I really like your customised announcements web part. Is there anyway to pin your web part to a certain view of an announcements list? What I'm trying to do is only show the announcments for a certain day through your web part.


Martin Spaldingcommented onFriday, 29-Aug-2008
Hi! I really like your customised announcements web part. Is there anyway to pin your web part to a certain view of an announcements list? What I'm trying to do is only show the announcments for a certain day through your web part.


Martin Spaldingcommented onFriday, 29-Aug-2008
Hi! I really like your customised announcements web part. Is there anyway to pin your web part to a certain view of an announcements list? What I'm trying to do is only show the announcments for a certain day through your web part.

Name:
URL:
Email:
Comments: