Removing closed web parts before saving a project workspace template

Recently I have seen this problem manifest itself at two customers, so I thought I would post about it to save anyone else running into it, or scratching their heads. When you customise project workspaces, or SharePoint workspaces in general, you have two options to remove the web parts from the page:

  • Close the web part – this stops the web part being rendered on the page, but still being created on each page load
  • Delete the web part – this removes the web part from the page completely.

By default, when you click on a web part without putting the page into edit mode, the first option presented to the user is to close the web part, but not to delete.

Close Web Part

It is only after you choose to edit the page that you will get an option to delete the web part, either in the context menu,

Delete Web Part - Context Menu

or via the Web Part Tools ribbon.

Delete a web part

So what is the problem you may be asking? Well, in both cases,  to customise the templates the users had simply closed instead of deleting the web parts and then thinking all was good, saved the workspace as a template. When that template was used to create a new site, each of the closed web parts were restored and visible once again, effectively removing the customisations.

Luckily fixing this is pretty simple.

First, we need to gain access to the Web Part Maintenance page which will display all web parts on the page and their associated status. To get there, simply add the following to the URL – ?Contents=1 so…

http://project.contoso.com/PWA/ProjectSiteTemplate/default.aspx

becomes

http://project.contoso.com/PWA/ProjectSiteTemplate/default.aspx?Contents=1

This will display the web part maintenance page, showing each of the web parts and their associated status.

Web Part Page Maintenance

To delete the closed web parts, simply select the correct items and click on Delete. This will delete the web parts from the page.

Finally, save the site as a template once again and all new sites created with it will reflect your customisations. Of course all of this can be avoided by a simple bit of training to delete instead of close,  but if the web parts have already been closed, this will help you fix it.

Advertisements

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