Request a Quote

Create Site Column, Content Type for multilingual site in SharePoint 2013

Create Site Column, Content Type for multilingual site in SharePoint 2013

To create site column, content type and page layout for multilingual site first we have add resource file in our SharePoint project. The basic mechanism of localizing a SharePoint 2013 feature is same as we have in SharePoint 2010 and in Moss 2007.

Resource File

To deploy resource file to 15 hives, first we have to map project with the SharePoint Resource folder. Select your project – >Add->SharePoint Mapped Folder

b2

 

Select resource folder. Now right click on the mapped folder and select add new item and add resource file. I have added resource file for German and English. In resource file name you have to specify language code. Refer below image.

b1

Add your localize string in resource file. You will need to set the Build Action in the resx property to ‘Content’ otherwise a deployment to hive won’t take place. Below is my resource file.

b3

Form feature property set the Default Resource File to the resource file name and also set “Require Resource” to TRUE.

Site Column

To add site column select your project, add new item and select site column. Open Element.xml file of site column.

<Elementsxmlns=”http://schemas.microsoft.com/sharepoint/”>

<Field

ID=”{37e7b0d2-f12d-4204-a652-97fdf4b034e6}”

Name=”EventName”

DisplayName=”$Resources:EventName”

Type=”Text”

Required=”FALSE”

Group=”Events”>

</Field>

</Elements>

 

Now you have to set display name of site column from resource file name. Instead of “EventName” you have to change your name from resource file. By doing so display name is different for English and German site. Name is internal name of site column field. If you want to access site column from code behind than you have to use internal name of site column.

Content Type

To add content type selects your project, add new content type and select base content type. Open Element.xml file of

 

<ContentTypeID=”0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900242457EFB8B24247815D688C526CD44D00D6DCE36F9DE043FE925DBA1E365BB75B”

Name=”$Resources:EventType”

Group=”Events”

Description=”$Resources:EventTypeDescription”

Inherits=”TRUE”

Version=”0″>

<FieldRefs>

<FieldRefID=”{37e7b0d2-f12d-4204-a652-97fdf4b034e6}”

Required=”FALSE”Name=”EventName” />

</FieldRefs>

</ContentType>

 

Set content type name from resource file. For content type we do not have display name property. We cannot set internal name for content type. If you want to access content type from code behind than you have to access with content type id.

 

Below is reference link for resource file

http://cann0nf0dder.wordpress.com/2013/05/16/resource-files-within-sharepoint-2010/

http://msreddysharepoint.blogspot.com/2013/01/resource-files-in-sharepoint-2010-and.html

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright © 2015 Trimantra Software Solution LLP- Software Outsourcing Company India. All rights reserved.