2

I'll try my best to describe this problem as it is quite tedious.

We have a sharepoint solution, in where we create Columns that are deployed through a feature. I added my custom columns to a custom Content Type. I then created my custom content type and declared all the field refs pointing to my fields inside my Columns.

I then used a already created Page Layout(not sure that the proper name in English) and included my Content Type inside its Element.xml

<File Path="PageLayouts\MJQ.Nouvelles.aspx" Type="GhostableInLibrary" Url="Layouts/News.aspx" >
  <Property Name="Title" Value="News Page layout" />
  <Property Name="ContentType" Value="$Resources:cmscore,contenttype_pagelayout_name;" />
  <Property Name="PublishingPreviewImage" Value="~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/CustomPageLayout.png, ~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/CustomPageLayout.png" />
  <Property Name="PublishingAssociatedContentType" Value=";#News;#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900242457EFB8B24247815D688C526CD44D00e1e2e3c8d71f4691bde302155bcf8a3200989a54f7a68341688674117f80da45f1;#"/>
</File>

The GUID properly reflects the GUID of my ContentType.

The problem here is when i create a Publishing page with Page Layout as my Content Type, i cannot see the Content Type's field inside my Application page "News.aspx".

this is added inside the News.aspx

<wss:RichHtmlField ID="txtTitre" runat="server" FieldName="MyCustomField" />

When i look inside the sharepoint site, into site columns i can see them, my content type also shows in the site content type.

When i also go to my page's library setting i can see the content type but the fields are missing.

Help :'(

1
  • Also when i use "Add from existing site columns" inside the site's library it puts the right field inside the column section in doubles and it then shows on my page correctly. Feb 29, 2012 at 17:51

3 Answers 3

2

One of the more annoying aspects of custom content types is that if you change a content type once it has been deployed, the redeploy of the updated solution containing the content type will not push those changes out to existing lists that use that content type. The changes will be correctly reflected in Site Content Types but not anywhere where that type is in use.

One way to get them to appear is to manually add the Site Columns that make up the Content Type to the existing list. When you do this, it will correctly realize that the Site Column being added is part of the content type and associate it properly.

5
  • 2
    The reason for this is that you are only changing the schema, not the instance. Use featureupgradeactions to add fields to content types. What Dave suggests is actually unsupported, NEVER change a schema only and then modify your site to match it.
    – Colin
    Feb 29, 2012 at 19:08
  • 1
    @Colin Agreed. I was merely offering it as a way to solve his immediate problem. A properly configured feature upgrade is the best long-term option.
    – Dave Wise
    Feb 29, 2012 at 19:37
  • I understand, but where do i use featureupgradeactions ?? Feb 29, 2012 at 20:19
  • Here is a good place to start : sharepointnutsandbolts.com/2010/06/…
    – Dave Wise
    Feb 29, 2012 at 20:23
  • Of course, but better to immediately point someone in the best practice way than a quick fix. If the op's environment is production, then having quick fixes in it can get out of hand real fast.
    – Colin
    Feb 29, 2012 at 20:49
0

Ok like the above comments say. I found the actual way to fix it. Simply delete all page of the said content type, go to the page list of the publishing site, delete the columns of the content type, delete the content type, next time you publish it will redeploy the content type with updated fields.

0

I did something similar where I added the content type to another temporary site 'Pages' library, used the 'Manage Content and Structure' page to move the pages from the old site to the temporary site, deleted the Content type from the old site, re-added the content type, then moved the pages back using 'Manage Content and Structure'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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