Archive for June, 2008

Creating MySites Programmatically

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.

Continue reading →

Denying User Access At The Site Level

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.

Continue reading →

Hiding Empty Publishing Fields in a Page Layout

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…

Continue reading →

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

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!