Home > sharepoint enterprise > Programatically create content type for multilingual site

Programatically create content type for multilingual site

November 13Hits:9
Advertisement

How to create content type for for multilingual site programatically.

Example Content type column internal name: firstName. English Display Name: First Name, German Display Name:Vorname. Same for all column name and content type name.

How can I do that?

Now how to create page layout from content type. As i am able to create page layout from content type. But for multiligual content type how can i do that? Below is my page layout module file. In that i have given content type name and content type id. But its not working

 <?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/">   <Module Name="VdePageLayout" Url="_catalogs/masterpage" RootWebOnly="TRUE">     <File Path="VdePageLayout\VdeArticalEventPageLayout.aspx" Url="VdeArticalEventPageLayout.aspx" Type="GhostableInLibrary">       <Property Name="Title" Value="My Custom Page Layout" />       <Property Name="ContentType" Value="$Resources:cmscore,contenttype_pagelayout_name;" />       <Property Name="PublishingAssociatedContentType" Value=";#$Resources:vde_Page;#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900242457EFB8B24247815D688C526CD44D00D6DCE36F9DE043FE925DBA1E365BB75B;#" />     </File>   </Module> </Elements> 

Answers

You can create contenttypes by code or declarative.

First create site columns and then the contenttype.

Create a feature that contains the columns and contenttype

If you want your columns multilingual you can localize your site columns and contenttypes

For example a localized field:

     <Field
           ID="{350b1356-7fef-434b-8fa2-f83b837d9c6c}"
           Name="FirstName"
           DisplayName="$Resources:field_firstName"
           Description="$Resources:field_firstName_description"
           Group="$Resources:field_group"
           Type="Note"
           Required="FALSE"
           NumLines="6"
           RichText="TRUE"
           RichTextMode="Compatible">
      </Field>

The same for a contenttype

      <ContentType ID="0x0100491AD40E0BEC4799A4A2015691A853F2"
                   Name="$Resources:contenttype_xxx"
                   Description="$Resources:contenttype_x_description"
                   Group="$Resources:contenttype_group"
                   Inherits="TRUE"
                   Version="0">
        <FieldRefs>
          <FieldRef ID="{350b1356-7fef-434b-8fa2-f83b837d9c6c}"
                    Required="FALSE" Name="FirstName" NumLines="6" />
            </FieldRefs>
          </ContentType>

Related Articles

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.783 s.