1
vote
1answer
249 views

To deploy page layout with feature at the same time of adding content type, the content type Id issue

First let me describe my situation: Now I'm using object model to add two content types (inheriting Pages content type) using the FeatureActivating methode in the Feature Receiver. in the same ...
4
votes
1answer
7k views

How to update a deployed content-type?

I created a content-type and applied it inside a document library. Now, if I go to the conent-type gallery and delete one of the fields, and then go back to the library and view the available ...
1
vote
1answer
415 views

Dispose issue when working with content types

I am seeing an issue with un-disposed SPRequest objects in the ULS logs when i work with content types in the object model. My code is as follows (in previous methods run as part of this request, the ...
1
vote
2answers
675 views

Changing PublishingPage.Layout doesn't change the content type?

I'm trying to update the Layout of the default.aspx page in my SharePoint publishing site and although the Layout does get updated, the ContentType of the page does not. Anyone have any ideas? Based ...
18
votes
3answers
1k views

Feature based XML vs. Object Model: Which is better for content type development?

I've been researching a few different ways to create content types and I recently discovered that you can use the Object Model to do this. All of the examples I have found online typically use XML ...
0
votes
2answers
644 views

Add site column to site content type error

var objWeb = properties.Feature.Parent as SPWeb; Guid webPublishingGuid = new Guid("94c94ca6-b32f-4da9-a9e3-1f3d343d7ecb"); SPFeature feature = null; SPSite site = objWeb.Site; feature = ...
9
votes
3answers
3k views

Is there a way to see if an SPField was created by a user?

I have some code where I am going through all of the Fields that belong to a content type. I'm curious if there is a way to check to see if the SPField was created by a user or if it is a system ...
0
votes
1answer
527 views

Re-order Content Types for a List in code

Has anyone been able to re-order content types for a list in code? If I'm given a specific content type, I want to make it the default in a list, by re-ordering the SPList.ContentTypes collection and ...