When you import a site template into Visual Studio and include the site columns, it will create a “Fields” item with a fancy icon:
I was asked earlier how to add a similar SPI to a SharePoint project. I assumed it was under the Add New Item dialog and an installed template, but I was wrong! So if you want to add a field SPI, you can do this:
- Add a new item, and choose the Empty Element and name it Fields (you can name it whatever you’d like)
- Open the SharePointProjectItem.spdata file that is under the Fields element (if you don’t see the file, click on Show All Files at the top of your project explorer)
- Change the Type value from
Microsoft.VisualStudio.SharePoint.GenericElement
to
Microsoft.VisualStudio.SharePoint.FieldAnd change the SupportedDeploymentScopes to “Web, Site” - Save the file
- Open and close your project, or unload and reload, and you’ll see the icon
If there’s an easier way, please leave a comment.