Home | Blog | Screencasts | Projects
# Sunday, October 26, 2008

You may have noticed in your coding adventures that some column names have had the spaces replaced with _x0020_. To understand why this is happening a little background is needed, a site column has two types of ID’s, the first is a unique name and the second is a unique ID. The ID is a GUID, however the unique name has two parts, the internal name and the display name, it is the internal name that has it’s space characters replaced with the hex value of the HTML space character: %20.

Now that you know why this happens, the way to prevent the _x0020_ characters using the web UI is to firstly create the column without any spaces (this will create the ID and the unique name), then after it has been created, you can go back and rename it (this will just updated the display name).

Sunday, October 26, 2008 10:09:00 PM (E. Australia Standard Time, UTC+10:00)  #    Comments [1] - Trackback
Sharepoint | Tip
Wednesday, December 10, 2008 2:29:48 PM (E. Australia Standard Time, UTC+10:00)
Hi Daniel

You are absolutely right. I came across this issue when trying to reveal additional columns in the Content Query Web Part (CQWP) by modifying the itemstyle.xsl and the <commonfields> line in the exported CQWP. After a greeat deal of angst I discovered that there are two names per site column - the internal name and the display name listed in the Site Columns Gallery and the content type. It is the internal name that has to be used to reveal the additional fields. The internal name MUST not contain spaces. The steps to follow are first, enter the column name without spaces and then second, come back and edit the column name to a more user-friendly format should it be deemed necessary.

Cheers
David
Comments are closed.
Statistics
Total Posts: 191
This Year: 0
This Month: 0
This Week: 0
Comments: 41