Checking out the web parts on a page using ?contents=1

In our environment, we have a small number of custom web parts that work with our company intranet.  Let’s call them “Current News – Left” and “Current News – Right”.  They take information from the “Current News” list and show them in two different columns on the page.  All in all, it works.

The problem is that some people see the Left and Right web parts and think they want to have the same layout on their page.  They put the page into Edit mode, add the web part, and BOOM!  Their page now throws a generic error and they have no idea how to get back into the page, much less what to do to fix it.

The problem is that the way these two web parts were coded, they require that the “Current News” list already exist.  If the list exists but has no items, that’s fine.  The Left and Right web parts are empty.  But if the list doesn’t exist at all, the page blows up.

In order to get the page into a mode where I can delete the web part(s), I go to the URL of their page and add “?contents=1” at the end.  That gives me the Web Part Page Maintenance screen for that page, and I can close, reset, or delete the web parts from that interface.

Once I remove the “Current News” web part(s), the page works again.  The other way I could fix it is to add the “Current News” list, but knowing about the “?contents=1” trick gives me a lot more control, and can be used in various situations.

One response to “Checking out the web parts on a page using ?contents=1

  1. awesome trick!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s