Archive

You are currently browsing the Cory Peters blog archives for June, 2008.

Jun

26

Creating MySites Programmatically

By Cory

Instead of asking every user to click on “My Site” and have the site provisioned for them it’s sometimes nice to already have the site created… or create it as part of the Employee Intake process. This is especially true if the My Site plays a role in a custom application as it did for one of my clients.

Read more »

Jun

12

Denying User Access At The Site Level

By Cory

It’s a pretty well known fact that SharePoint cannot deny access for a user below the Web Application level as shown in the screenshot below. Sadly there will be no code samples for this one as it’s pretty proprietary stuff.

Read more »

Jun

11

Hiding Empty Publishing Fields in a Page Layout

By Cory

Most of the time when you’re rendering web content that content will exist in a container or have a header or a footer, etc. If you’re rendering an HTML publishing field within SharePoint the user could have simply left the field blank (unless you make the field required of course). In this case you probably don’t want to render the container/header/footer if there isn’t going to be any content. So let’s get down to business…

Read more »

Jun

10

Deleting a Page Layout or Master Page that is no longer referenced

By Cory

There is a fairly well known bug that prevents you from deleting both page layouts and master pages even though they are no longer in use. If you do try to delete either a page layout or master page you will receive the following error:

“This item cannot be deleted because it is still referenced by other pages. “

There is a workaround for this problem but it requires SharePoint designer. Here is my similar solution except that no SharePoint designer is required.

  1. Browse to the “Master Page Gallery”.
  2. Select “Actions” and “Open with Windows Explorer”
  3. Right click on the white area and select “New” > “Folder”
  4. Drag the page layout or master page into the new folder
  5. Right click on the new folder and select “Delete”
  6. Confirm the box

Done!