Tuesday, 16 July 2013

Content Type Page Layout


STEP 1: Create one ‘Empty SharePoint project’ in visual studio
STEP 2: Add the ‘Content Type’
 
 
STEP 3:
Add the ‘Module’
 
 
STEP 4:
'PageLayoutsModule'


STEP 5:

Open the element file in ‘TestContentType’ and replace the below text
<?xml version="1.0" encoding="utf-8"?>

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

  <!-- Parent ContentType: Page (0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39) -->

  <ContentType ID="0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF390024397d6629eb42dcad9ec5d5a1a4f3e1"

               Name="TestPageContentType" Group="Custom Content Types"

               Description="My Content Type" Inherits="TRUE" Version="0">

    <FieldRefs>

      <FieldRef ID="{47934985-E445-4A6D-9A15-751FF56F8AA8}"

                Name="PublishingPageContent" />

    </FieldRefs>

  </ContentType>

</Elements>

Check the ‘SharePointProjectItem.spdata’ in ‘TestContentType’:

<?xml version="1.0" encoding="utf-8"?>

<ProjectItem Type="Microsoft.VisualStudio.SharePoint.ContentType" DefaultFile="Elements.xml" SupportedTrustLevels="All" SupportedDeploymentScopes="Web, Site" xmlns="http://schemas.microsoft.com/VisualStudio/2010/SharePointTools/SharePointProjectItemModel">

  <Files>

    <ProjectItemFile Source="Elements.xml" Target="VCSBContentType\" Type="ElementManifest" />

  </Files>
</ProjectItem> 

STEP 6: 
Open the element file in ‘PageLayoutsModule’ and replace the below text:
<?xml version="1.0" encoding="utf-8"?>

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

<Module Name="PageLayoutsModule" List="116"

          Url="_catalogs/masterpage"> 

  <File Path="PageLayoutsModule\VCSBOneColumnLayout.aspx"

        Url="OneColumnLayout.aspx"

        Type="GhostableInLibrary">

    <Property Name="ContentType"

              Value="$Resources:cmscore,contenttype_pagelayout_name;"/>

    <Property Name="PublishingAssociatedContentType"

              Value=";#TestPageContentType;#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF390024397d6629eb42dcad9ec5d5a1a4f3e1;#"/>

    <Property Name="Title"

              Value="One column Page Layout"/>

  </File>

</Module>

  </Elements>
 
Check the ‘SharePointProjectItem.spdata’ in ‘PageLayoutsModule’:

<?xml version="1.0" encoding="utf-8"?>

<ProjectItem Type="Microsoft.VisualStudio.SharePoint.Module" DefaultFile="Elements.xml" SupportedTrustLevels="All" SupportedDeploymentScopes="Web, Site" xmlns="http://schemas.microsoft.com/VisualStudio/2010/SharePointTools/SharePointProjectItemModel">

  <Files>

    <ProjectItemFile Source="Elements.xml" Target="PageLayoutsModule\" Type="ElementManifest" />

    <ProjectItemFile Source="OneColumnLayout.aspx" Target="PageLayoutsModule\" Type="ElementFile" />

  </Files>

  <SafeControls>

    <SafeControl Name="SafeControlEntry1" Assembly="$SharePoint.Project.AssemblyFullName$" Namespace="TestPageContentType" TypeName="*" IsSafe="true" IsSafeAgainstScript="false" />

  </SafeControls>

</ProjectItem>

 
STEP 7:
 
Open the ‘OneColumnLayout.aspx’ page

Copy & paste the below text(This is the content type control)

<PublishingWebControls:EditModePanel runat="server" id="EditModePanel1" PageDisplayMode="Display">

                   <SharePointWebControls:FieldValue FieldName="PublishingPageContent" runat="server"/>  

                    </PublishingWebControls:EditModePanel>

         <PublishingWebControls:EditModePanel runat="server" id="EditModePanel2" PageDisplayMode="Edit">

         <PublishingWebControls:RichHtmlField FieldName="PublishingPageContent" runat="server" id="RichHtmlField1"/>

         </PublishingWebControls:EditModePanel>

STEP 8:

Deploy the solution.

SharePoint online - Get List-item attachments and Display to div

Step 1 : Create a List ex: TestList and attach few images Step 2 : Copy and Pastet the below coding in App.js var  Items =  null ; ...