Custom Site Columns and Custom Site Content Types Not Displaying in Gallery

I have created a custom site column and a custom content type containing the site column. These never show in the galleries. I have tried using a custom group name in my elements.xml and the custom group never shows up and so the content type and/or site column never shows up. I tried it with no group and it didn't work. I tried it with an existing group and it didn't work. With each attempt I made sure I deactivated the feature and uninstalled it before making the changes to elements.xml. I also even reset the iis for good measure, but nothing seems to work. I don't believe there's anything wrong with my feature.xml and elements.xml or else it wouldn't install and activate correctly, which it does. I get no error messages, it just simply won't show up in the gallery. I am working in SharePoint Foundation 2010 so there are no publishing features. Does anybody know what could cause this?
LVL 9
BobHavertyComhAsked:
Who is Participating?
 
dhawalsethCommented:
Dear Bob,

Few things I noticed at one go:
When you declare a 'FieldRef' in content type as:
<FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" DisplayName="Item" Required="TRUE" Sealed="TRUE"/>
-the 'DisplayName' attribute is important. Also just try 'Hidden=False' it is by default if you don't use this attribute.
-Just check at the correct group for the content type or try using 'Find' option.
'SourceID' attribute is not important and so is static name.

Have a look at the link below to help/guide you more:
http://msdn.microsoft.com/en-us/library/aa543526.aspx

Enjoy!!!
0
 
dhawalsethCommented:
Dear Bob,

Do try to deploy the site columns feature first and verify whether they appear or not. Do it at the site collection level. You need to check the scope of the feature you have created.
Also check you are not using OOB column names by mistake. The custom field example I am sharing with you, is reused in the content type example as well.


I am sharing few examples of how we have created columns/fields and content type.
Custom Fields:
<Field Type="Text" DisplayName="JobNumber" Required="FALSE" EnforceUniqueValues="FALSE" Indexed="FALSE" MaxLength="255" Group="GroupCustomColumns" ID="{ce4e0380-0dca-452a-aa88-6c53a8acc503}" StaticName="JobNumber" Name="JobNumber" />

Content Type:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <!-- Parent ContentType: Item (0x01) -->
  <ContentType ID="0x010008956C12FC6C48EA9F2A724AB58F1C48"
               Name="TranslatedItem"
               Description="Translated News Item"
               Group="Custom Content Types"
               Version="1">
    <Folder TargetName="TranslatedItem"/>
    <FieldRefs>      
      <FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" Required="TRUE" />
      <FieldRef ID="{4e8fbd75-c90a-4925-a284-e8ab2db9b12d}" Name="ShortDescription" Required="TRUE" />
      <FieldRef ID="{aee88cf2-c09d-41db-b3e1-1884e3f39100}" Name="LongDescription" Required="TRUE" />
      <FieldRef ID="{B46E3042-FAE0-4D32-A0BA-8AA3368443D7}" Name="QuickLinks"/>
          <FieldRef ID="{be2bdb45-f18b-4821-9432-cdaba672780a}" Name="OriginalVersionID" Hidden="TRUE" />
      <FieldRef ID="{ce4e0380-0dca-452a-aa88-6c53a8acc503}" Name="JobNumber" Hidden="TRUE" />
         <!--End-->
    </FieldRefs>
  </ContentType>
</Elements>

Open in new window


Also verify that you by accident, did not set the 'Hidden' attribute value while creating the content type.

(the snapshots/shares are from 'Elements.xml' file)

Enjoy!!!!!
0
 
BobHavertyComhAuthor Commented:
Please let me note that I am not trying to deploy a wsp, this is a course I am taking and they want you to know how to deploy features manually so that you understand what is underneath the hood.

First created a Site Column scoped to "site" in VS. Copied the feature.xml and it's subsequent elements.xml to the new feature folder that I created in the features folder under SP root/templates/features. Ran sysadm -o installfeature -name myfeaturename. It told me operation successful. Saw the site column feature in the site collection level features manager. Activated it just fine. No errors. Went to site collection site columns page and it does not show up. Couldn't solve that problem so I moved on

Second, created a content type that includes my site column. Used same procedures described above and it installed and activated fine, but again, the new site content type does not show up in the site collection content type page. Same problem again. What's weird is that this activation should have failed because it contains a site column that does not show up on the list. So maybe, somehow that site column is actually there but refuses to show up on the site collects site columns page. Couldn't fix that problem.

Third, created a list instance feature that included the missing site content type, which included the missing site column type. Now, there's no way this should install and/or activate, but it did. And, of course, the list does not show up, even aside from the quick launch. It just seems like it's not there at all.

So how are all three related oddities possible?

I doubled checked content type and hidden was not set to true, which would make sense because I never set it, so the default is true.

As an example, here is the code specifically for the content type. It's very basic

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/" Id="24AB9DF5-91B4-4D38-82D2-5C8016EA0BB2">
  <ContentType ID="0x0100701E3A9BE110417296D654FB25BE86E2" Name="ColorType" Group="List Content Types">
    <FieldRefs>
      <FieldRef ID="{b6217d98-da87-4eda-b2c4-1d9fb2ee9622}" Name="FavoriteColor"/>
    </FieldRefs>
  </ContentType>
</Elements>

Here's elements.xml for the site column that the above references

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/" Id="9AEADD11-0449-44FE-9309-87E7737D120C">
  <Field Type="Choice"
        DisplayName="Favorite Color"
        Description="Test column for making a site column feature"
        Required="FALSE"
        EnforceUniqueValues="FALSE"
        Indexed="FALSE"
        Format="RadioButtons"
        FillInChoice="FALSE"
        Group="Bob's Group"
        ID="{b6217d98-da87-4eda-b2c4-1d9fb2ee9622}"
        SourceID="{2b440dd1-336c-411a-a478-adbbce579d28}"
        StaticName="FavoriteColor"
        Name="FavoriteColor">
    <Default>Red</Default>
    <CHOICES>
      <CHOICE>Red</CHOICE>
      <CHOICE>Blue</CHOICE>
      <CHOICE>Green</CHOICE>
    </CHOICES>
  </Field>
</Elements>

The id from the site column matches the id referenced in the fieldref node of the content type.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
BobHavertyComhAuthor Commented:
Ahh, display name. That might do it. I'm recreating the whole thing for good practice anyway, so I'll make sure I remain aware of that while recreating. Seems to make a lot of sense. It's there. It has to be there or else the list instance that uses this content type couldn't possibly install and activate. I'll let you know.
0
 
dhawalsethCommented:
Sure Bob,

I am happy for you....


Enjoy!!!
0
 
BobHavertyComhAuthor Commented:
Thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.