A Practical Guide to SharePoint 2013

A Practical Guide to SharePoint 2013
A Practical Guide to SharePoint 2013 - Book by Saifullah Shafiq

Wednesday, February 7, 2007

Adding a field to the document library template - MOSS 2007

Note: Don't forget to make backup copies of the files you modify in this tip.
1. Open schema.xml file for the document library that is located in the following path:
LocalDrive:Program FilesCommon FilesMicrosoft Sharedweb server extensions12TEMPLATEFEATURESDocumentLibraryDocLib
2. Locate <Fields> tag and add following field inside the <Fields> tag:
  <Field ID="{20487AC7-D872-4B10-ACB8-CF3002C29687}" Type="Text" Name="MyField" ShowInNewForm="FALSE" ShowInFileDlg="FALSE" DisplayName="$Resources:core,MyField;" Filterable="TRUE" Sortable="TRUE" Sealed="TRUE"  SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="MyField"><!-- _locID@DisplayName="camlid2" _locComment="  " -->
      </Field>
Field ID should be unique. Run Select NewID() in SQL Query Analyzer to get a new GUID and use it as the field ID.
3. Open core.en-US.resx file located in the following path:
LocalDrive:Program FilesCommon FilesMicrosoft Sharedweb server extensions12Resources
4. Locate following tag in the file:
  <!-- shared resources -->
and add following lines in this section (shared resouces section)
  <data name="MyField">
    <value>My Demo Field</value>
  </data>

5. Save the changes and reset IIS. Next time when you will create a document library, this field will be a part of your document libray.
I once blogged about creating site definitions in SPS 2003. Things have changed a lot in version 2007 but this time we have lot of help available in the form of blogs, forums, etc. If you want to learn more about site definitions in 2007, read following excellent articles by Todd Baginski:

-SSA
Published Wednesday, February 07, 2007 6:01 PM by ssa

Comment Notification

If you would like to receive an email when updates are made to this post, please register here
Subscribe to this post's comments using RSS

Comments

 

Mike Walsh's WSS and more said:

February 11, 2007 1:59 AM