Solved

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

Posted on 2013-01-29
6
800 Views
Last Modified: 2013-02-02
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?
0
Comment
Question by:BobHavertyComh
  • 3
  • 3
6 Comments
 
LVL 7

Expert Comment

by:dhawalseth
ID: 38834208
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
 
LVL 9

Author Comment

by:BobHavertyComh
ID: 38839708
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
 
LVL 7

Accepted Solution

by:
dhawalseth earned 500 total points
ID: 38842624
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 9

Author Comment

by:BobHavertyComh
ID: 38843290
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
 
LVL 7

Expert Comment

by:dhawalseth
ID: 38843363
Sure Bob,

I am happy for you....


Enjoy!!!
0
 
LVL 9

Author Closing Comment

by:BobHavertyComh
ID: 38847296
Thank you
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Work Over Net is a new and very powerful collaboration product. With its new easy interface it is becoming very competitive to other similar products like webex and office interactive. WON 2010 have the standard business tools needed for multi-offic…
If you create your solutions on SharePoint sooner or later you will come upon a request to set  permissions of the item depending on some of the item's meta-data - the author, people assigned as approvers, divisions, categories etc. The most natu…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now