Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a few Content Types that inherit from a base Content Type. These are all wrapped up as part of my solution.

I wondered, as it is possible to add additional columns to a child Content Type using FieldRefs, is it possible to remove a column for the child Content Type that is specified in the parent Content Type?

It can be done on the front-end but I wondered if I could do it as part of my deployment?

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

You could certainly use a Feature Receiver to hide the Field (FieldRef) on your child Content Type.

It may be possible to put a FieldRef in the definition of the inheriting Content Type with the same ID as the field ref in the parent and set it to Hidden=True, but I have no idea if this works it's just speculation.

The Feature Receiver will definitely work (assuming you code it right!)

share|improve this answer
    
Thanks for the answers. The hidden=true seems like a viable and straight for work around. I will also have a look at a feature receiver. Thanks Charles. –  dmce May 1 '10 at 22:21
add comment

I've also tried Pete's recommendation in my Visual Studio sharepoint solution. Adding the RemoveFieldRef elements into my FieldRefs> element seems to have no effect whatsoever. Would like to know if anywone has further experience with this. I don't mind writing feature receiver code, but would prefer to declare what I can.

share|improve this answer
add comment

Try googling 'RemoveFieldRef'

I've been trying to do something similar. Heres an example of a 'Firm Page' content type that derives from the 'Page' content type in a publishing site. I am attempting to remove the contact details. It isn't working for some reason but i think its the way its meant to be accomplished. Hope this helps..

<ContentType ID="0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39001C6234A536D8468dB0EE7E40FFDEEA45"
           Name="Firm Page"
           Group="Firm Content Types"
           Description=""
           Inherits="TRUE"
           Version="1">
<FieldRefs>

  <RemoveFieldRef ID="{aea1a4dd-0f19-417d-8721-95a1d28762ab}" Name="PublishingContact"/>
  <RemoveFieldRef ID="{c79dba91-e60b-400e-973d-c6d06f192720}" Name="PublishingContactEmail"/>
  <RemoveFieldRef ID="{7546ad0d-6c33-4501-b470-fb3003ca14ba}" Name="PublishingContactName"/>
  <RemoveFieldRef ID="{dc47d55f-9bf9-494a-8d5b-e619214dd19a}" Name="PublishingContactPicture"/>
  <RemoveFieldRef ID="{543bc2cf-1f30-488e-8f25-6fe3b689d9ac}" Name="PublishingRollupImage"/>

</FieldRefs>

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.