In this post I would like to describe how to add OTB Enterprise keywords field into custom content type declaratively. Enterprise keywords – is a standard managed metadata field which is binded to the standard term set in Term store: System > Keywords. It allows users to specify keywords in content metadata, e.g. users can apply some keywords to the document, to the page or to the list item. These keywords will be saved in the Keywords term store and will be available for other users for selection.
You can add Enterprise keywords to the content type via UI (this field is located under Enterprise keywords group). As you probably know when you need to add some managed metadata field to the custom content type declaratively you need to add 2 fields: one for taxonomy field itself and other is hidden field of Note type. In order to add Enterprise keywords into content type declaratively for provisioning you also need to add 2 fields: one is the keywords “TaxKeyword” (id = 23F27201-BEE3-471E-B2E7-B64FD8B7CA38) and another is hidden field “TaxKeywordTaxHTField” (id = 1390A86A-23DA-45F0-8EFE-EF36EDADFB39) for the keywords (both fields has the same predefined id on all Sharepoint installations), You need to use the following code:
With this code you will be able to use OTB Enterprise keywords field in your content types.