I'm just wondering if Content Types are always only made out of Site Columns, or if it's possible to define Fields that only exist on that Content Type? (Like how you can add a custom Column to a list)
I'm currently creating some Content Types in Visual Studio using Elements.xml and just wonder if I'm "polluting" site columns with fields that are only useful on that content type.
Creating site columns is the right way to go. You can add a list column to a list or library that is associated with a content type, but it isn't the same. The point is really to define your data properly. I kind of think that it is more likely that you are "polluting" the environment when you create the same field 10x as a list field versus a Site Column.
I agree with Mike.
Moreover, to make it feel less like pollution of your site columns, you can set the group of your site columns to a name that includes the name of the "primary" Content Type they are used in. This way the page that shows all site columns will appear well organised.
So I did create on an SPWeb 20 custom lists and then a tasks list. For each of those 20 lists I've created 20 site lookup columns. I then created 20 Content Types based on Task content type. Then I've added each content type to the Tasks list. After that I've added each lookup site column to the corresponding list content type. So far so good. I've built a custom WebPart that displays task items...); Update: I've built a C# console app which creates all lists / lookup columns / content types and add the lookup column to corresponding content type. Result: same thing, same magic number 13. Anyone
I've encountered the strangest problem. I've got two features: ContentTypes: contains a couple of custom fields and a content type (based on plain ol' 0x01) called Withdrawals that uses them. Scoped to Site. Registration: contains a ListTemplate and a ListInstance that just modifies a basic Custom List to enable content types and add my custom content type. Scoped to Web. Here's what's happening. When I activate ContentTypes, the content type and field are deployed as expected into my site collection. When I activate Registration, the list is provisioned and the content type is added
. At that point, I am modifying the content type using the SharePoint interface (i.e changing advanced settings, adding columns, etc). What I would like to do, is after I have made my changed, update my CAML in Visual Studio to match my changes. I want to do this because I am creating custom fields and content types for my project and want to create a solution with these customizations. Since there doesn't seem to be a way to do this (create custom fields and content types) as a solution using SharePoint without putting them into a list, I am using Visual Studio and CAML for this. I also
implications to be aware of i.e. do the content types need the same site columns for the fields you want to display? I'm looking to do this in SP2010 but would be interested to know if the same applied for MOSS. ...Is it possible to use the Content Query web part to filter on multiple specific content types that do not have a parent/child relationship? I have a requirement to show Events (from a calendar) and Announcements (from an Announcement list) aggregated in the same area but as these come from two different branches in the content type tree, I can't do this via configuration of the web part. Would
When defining content types in SharePoint 2010, there is a new Inherits attribute. According to the SDK: The value of this attribute determines whether the content type inherits fields from... is FALSE or absent and the parent content type is a built-in type, the child content type inherits only the fields that were in the parent content type when SharePoint Foundation was installed. The child content type does not have any fields that users have added to the parent content type. I'm finding that whenever Inherits=FALSE the content type is deployed internally
by the columns. Update: I followed Koen's blog post. His approach is to add the fields to the start of the content type's elements.xml. The steps in his post worked perfectly! However when I tried to follow the same approach with the content type I'm working on, the site columns were deployed correctly but still not the content type! I've done a lot of testing and may be confused now about...I've written a feature that deploys new columns along with a content type containing the columns. The feature is Site scoped and written in Visual Studio 2010 to deploy to SharePoint 2010. When
A common issue with my customers is that they define a number of content types that should be available on a document library. That library is part of a custom site template and pretty soon we'll have 200 sites using that template. Now the customer realize that they need two new content types on that library. Oh, and they will need those content types on the existing sites as well. I might have misunderstod something about content types or just misconfigured the library, but so far the only way I have been able to add those new content types on existing sites have been through a powershell
This is mainly a verification question as I have been fighting with an issue for a couple of days now. I have two lists derived from 2 custom content types. Both content types used the task base content type. Each of the derived content types have custom form rendering templates. I am using a custom usercontrol with codebehind added to the .ascx page as a control to redraw the forms differently... that not really matter? I ask because I can change the content type of the nonworking one to use the same template as the working one and it will load just fine. UPDATE: I tried changing the type and even
I've ran into a problem when trying to create custom new item forms for a list that has multiple content types. I've tried inserting a custom list form for a content type (this content type isn't the default) and I'm shown all fields for every content type. This only happens when I choose a custom list form for a content type that isn't default. So, I'm left with thinking, I should create the link to the new item form with a query string that auto-populates the content type and then only display the correct fields for each different content type. Seems a little hackery, so I'd like