One of the out of the box web parts that is a great addition to any Intranet homepage is the Announcements Web Part. It allows to easily create short notices and company announcements and makes the content of Intranet Homepage more dynamic and fresh. Each of the announcements contains a brief headline, as well as short description of the announcement. In this blog post, I would like to explain how you can automatically hide expired announcements from the list, thus keeping the content of you Intranet less cluttered and fresh. Please note that the Announcements web part is a classical web part and can only be used on Wiki Pages, not the Modern pages.
By default, there is an expired date field that the user can enter when creating announcements. It is optional.
However, just by populating one, won’t hide the announcements from the list past the expiration date. In the example below, I have two announcements in a list and while one has an expiration date in the past – it is still displayed on a page.
There are two options for you to hide the announcement past the expiration date.
Option 1: Use built-in Summary View
- Edit the Page where the announcement is embedded
- Edit the web part
- Under Selected View, choose Summary View. Then click OK.
- Make sure to Save the page as well when you exit from editing
- You will now get a view on the page that only displays non-expired announcements. That said, it does change the look and feel of how announcements are displayed as well, by incorporating the headline as well as the body of the announcement right into the page. It might not be a bad thing, as it gives the user all the information without requiring them to click through.
Option 2: Create a filtered view
- If you want to stick with the regular list (headline-only) view, you need to create a manual view that would filter out all expired events. To do that, create a new view. You might make it a default view while you are here as well. Just check off “Make this the default view” box.
- Scroll down to the Filter section. Click the Show items only when the following is true: radio button. The choose Expires column is greater than or equal to and type [Today] in the text field. Essentially, we are asking SharePoint to only display events that have the expiration date either today or in the future.
- Click OK at the bottom of the screen to create a view.
- You will now get a view that hides expired events
- If you want to make sure your homepage displays the new view, edit the page, then edit the web part and choose the new view you created. Click OK.