Monday, February 8, 2010

How to modify a SharePoint _Hidden Site Column

Putting aside the debate (for now) of whether or not you should modify native (aka out-of-the-box) Site Columns in SharePoint (WSS v3.0 / MOSS 2007), here is a way to easily modify site columns that are in the _Hidden Site Column group. <Std. Disclaimer> If you don't understand what this is about, don't risk doing this.</Std.Disclaimer>:


First get to an admin page that shows you the Site Column. You can do this by going to Site Settings > Site Content Type Gallery and click on a Site Content Type that includes the _Hidden Site Column you want to tweak:


Here is a partial view of the Site Content Type Gallery. We are going to click on the "Document" CT so we can modify the _Hidden Site Column "Name."





Note in the following view (it's hard to see, though) that the "Name" site column is NOT a link but "Title" site column is a link to its modify page.



I.e. If we click on the "Title" column's link, we get to this page, which in turn has a link to edit the site column:





If we clicked on that link it takes us to the edit page for the site column:



Now look at the URL for the "Change Site Content Type Column: Document" page:

http://MyMOSSSite/_layouts/ManageContentTypeField.aspx?ctype=0x0101&Field=Title&Fid=%7Bfa564e0f%2D0c70%2D4ab9%2Db863%2D0177e6ddd247%7D

AH!! Lookie there, a field name and GUID in the querystring. So now we just need the field ID for the Name field that the SharePoint GUI is refusing to render a link for. Well, let's look at the source for this page (where the "Columns" section is described):





WSS uses the field GUID as the id so there is the GUID for the "Name" site column -

So now we can do some substition...

The "Title" Site Column's (field) ID=fa564e0f-0c70-4ab9-b863-0177e6ddd247

The "Name" Site Column's (field) ID=8553196d-ec8d-4564-9861-3dbe931050c8

and looking at the link for the "Title" column's editing page...

ManageContentTypeField.aspx?ctype=0x0101&Field=Title&Fid=%7Bfa564e0f%2D0c70%2D4ab9%2Db863%2D0177e6ddd247%7D


So let's hack our way to the "Name" S.C. field "Manage" page using the "Name" S.C.'s GUID:

ManageContentTypeField.aspx?ctype=0x0101&Field=Title&Fid=%7B8553196d-ec8d-4564-9861-3dbe931050c8%7D

which we should clean up to have the dashes in the GUID HTML encoded as %2D to get...

ManageContentTypeField.aspx?ctype=0x0101&Field=Title&Fid=%7B8553196dec8d%2D4564%2D9861%2D3dbe931050c8%7D


Which for the full URL works out to be:

http://MyMOSSSite/_layouts/ManageContentTypeField.aspx?ctype=0x0101&Field=Title&Fid=%7B8553196d%2Dec8d%2D4564%2D9861%2D3dbe931050c8%7D

Which when requested against our SharePoint site gets us:



And from there we can click that edit link to get the page to edit the _Hidden site column "Name":



Insert evil Gene-e-Us laugh here.

Warning: Do NOT change the group or column name without potentially really hosing up your WSS/MOSS site. For this example I was changing the "Description" value for the "Name" field.


If you mess up and rename an out-of-the-box site column and try to change it back, you'll get a warning that prevents you from doing so. If you muck that up, see this KB article: http://support.microsoft.com/kb/923589


If a content type that contains the site column you want to modify is not listed in the Site Content Type Gallery, you may need to drill into the list of columns via a list that uses that content type. For example, the "Event" content type is _Hidden but you can get to it by opening up a calendar list's list settings:




Here is a site that has a full list of the SharePoint ID's for a more direct route:

http://www.aarebrot.net/site/index.php/sitedefinitions/20-sharepointcolumnfieldids



No comments: