Hiding Wiki Library Custom Columns

I was intrigued by Phil Wicklund‘s post on removing custom columns from wiki pages until I saw that his solution requires modifying the underlying template file (DocumentTemplates\wkpstd.aspx) and will affect every wiki on the farm. Fortunately, the control he suggests deleting (ListFieldIterator) respects fields’ ShowInDisplayForm property, which can be set in a number of ways:

  • Feature: Attribute of Field or FieldRef elements in a site column, content type or list template
  • Feature receiver:
    var web = properties.Feature.Parent as SPWeb;
    var field = web.Lists["MyWiki"].Fields["HideMe"];
    field.ShowInDisplayForm = false;
    field.Update();
  • PowerShell:
    $web = Get-SPWeb $url
    $f = $web.Lists['MyWiki'].Fields['HideMe']
    $f.ShowInDisplayForm = $false
    $f.Update()
    $web.Site.Dispose()
  • Sharad Kumar‘s Form Settings editor (CodePlex)

Any of these should be preferred to modifying the hive and breaking supportability.

One Response to “Hiding Wiki Library Custom Columns”

  1. Phil Wicklund Says:

    Nice tip! I didn’t know that property existed… but now that I do, I can think of a ton of great reasons to use it.

    Phil


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 )

Connecting to %s

Follow

Get every new post delivered to your Inbox.