Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / productivity / SharePoint

SharePoint Fields in Page Layout

4.00/5 (1 vote)
2 Oct 2015CPOL 9.1K  
SharePoint fields in page layout

The following snippets will help you add different types of SharePoint fields into your page layout.

  • Text field
    HTML
    <div xmlns="">
            <!--CS: Start Page Field: Title Snippet-->
            <!--SPM:<%@Register Tagprefix="PageFieldTextField" 
            Namespace="Microsoft.SharePoint.WebControls" 
    	Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, 
    	PublicKeyToken=71e9bce111e9429c"%>-->
            <!--SPM:<%@Register Tagprefix="Publishing" 
    	Namespace="Microsoft.SharePoint.Publishing.WebControls" 
    	Assembly="Microsoft.SharePoint.Publishing, Version=16.0.0.0, 
    	Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
            <!--MS:<PageFieldTextField:TextField FieldName="fa564e0f-0c70-4ab9-b863-0177e6ddd247" 
    	runat="server">-->
            <!--ME:</PageFieldTextField:TextField>-->
            <!--CE: End Page Field: Title Snippet-->
    </div>
  • Note field
    HTML
    <div xmlns="">
                    <!--MS: <Publishing:EditModePanel runat="server" 
                    PageDisplayMode="Edit">-->
                    <!--CS: Start Page Field: Comment Snippet-->
                    <!--SPM:<%@Register Tagprefix="PageFieldNoteField" 
                    Namespace="Microsoft.SharePoint.WebControls" 
                    Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, 
                    PublicKeyToken=71e9bce111e9429c"%>-->
                    <!--SPM:<%@Register Tagprefix="Publishing" 
                    Namespace="Microsoft.SharePoint.Publishing.WebControls" 
                    Assembly="Microsoft.SharePoint.Publishing, Version=16.0.0.0, 
                    Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
                    <!--MS:<PageFieldNoteField:NoteField 
                    FieldName="9da97a8a-1da5-4a77-98d3-4bc10456e700" runat="server">-->
                    <!--ME:</PageFieldNoteField:NoteField>-->
                    <!--CE: End Page Field: Title Snippet-->
                    <!--ME:</Publishing:EditModePanel>-->
                </div>
  • Taxonomy field
    HTML
    <div xmlns="">
                    <!--MS: <Publishing:EditModePanel runat="server" 
                    PageDisplayMode="Edit">-->
                    <!--CS: Start Page Field: Taxonomy Snippet-->
                    <!--SPM:<%@Register Tagprefix="Publishing" 
                    Namespace="Microsoft.SharePoint.Publishing.WebControls" 
                    Assembly="Microsoft.SharePoint.Publishing, Version=16.0.0.0, 
                    Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
                    <!--SPM:<%@ Register Tagprefix="Taxonomy" 
                    Namespace="Microsoft.SharePoint.Taxonomy" 
                    Assembly="Microsoft.SharePoint.Taxonomy, Version=16.0.0.0, 
                    Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>-->
                    <!--MS:<Taxonomy:TaxonomyFieldControl 
                    FieldName="1dd07715-ff06-4ade-9ac6-efd353ef1d00" runat="server">-->
                    <!--ME:</Taxonomy:TaxonomyFieldControl>-->
                    <!--CE: End Page Field: Taxonomy Snippet-->
                    <!--ME:</Publishing:EditModePanel>-->
                </div>
  • DateTime field
    HTML
    <div xmlns="">
                    <!--MS: <Publishing:EditModePanel runat="server" 
                    PageDisplayMode="Edit">-->
                    <!--CS: Start Page Field: datetime Snippet-->
                    <!--SPM:<%@Register Tagprefix="PageFieldDateTimeField" 
                    Namespace="Microsoft.SharePoint.WebControls" 
                    Assembly="Microsoft.SharePoint, Version=16.0.0.0, 
                    Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
                    <!--SPM:<%@Register Tagprefix="Publishing" 
                    Namespace="Microsoft.SharePoint.Publishing.WebControls" 
                    Assembly="Microsoft.SharePoint.Publishing, Version=16.0.0.0, 
                    Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
                    <!--MS:<PageFieldDateTimeField:DateTimeField 
                    FieldName="2e9f7b5a-f5ec-470d-9b4d-e1abaab8ee87" runat="server">-->
                    <!--PS: Start of READ-ONLY PREVIEW (do not modify)-->
                    <div align="left" class="ms-formfieldcontainer">
                    <div class="ms-formfieldlabelcontainer" nowrap="nowrap">
                    <span class="ms-formfieldlabel" nowrap="nowrap">Review Date</span>
                    </div><div class="ms-formfieldvaluecontainer">20/05/2013</div></div>
                    <!--PE: End of READ-ONLY PREVIEW-->
                    <!--ME:</PageFieldDateTimeField:DateTimeField>-->
                    <!--CE: End Page Field: datetime Snippet-->
                    <!--ME:</Publishing:EditModePanel>-->
                </div>
  • RichHtml field
    HTML
    <div xmlns="">
                    <!--CS: Start Page Field: Rich Html Snippet-->
                    <!--SPM:<%@Register Tagprefix="PageFieldRichHtmlField" 
                    Namespace="Microsoft.SharePoint.Publishing.WebControls" 
                    Assembly="Microsoft.SharePoint.Publishing, Version=16.0.0.0, 
                    Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
                    <!--MS:<PageFieldRichHtmlField:RichHtmlField 
                    FieldName="f55c4d88-1f2e-4ad9-aaa8-819af4ee7ee8" runat="server">-->                
                    <!--ME:</PageFieldRichHtmlField:RichHtmlField>-->
                    <!--CE: End Page Field: Rich Html Snippet-->
                </div>
  • Image field
    HTML
    <div xmlns="">
                    <!--CS: Start Page Field: Image Snippet-->
                    <!--SPM:<%@Register Tagprefix="PageFieldRichImageField" 
                    Namespace="Microsoft.SharePoint.Publishing.WebControls" 
                    Assembly="Microsoft.SharePoint.Publishing, Version=16.0.0.0, 
                    Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
                    <!--MS:<PageFieldRichImageField:RichImageField 
                    FieldName="3de94b06-4120-41a5-b907-88773e493458" runat="server">-->
                    <!--ME:</PageFieldRichImageField:RichImageField>-->
                    <!--CE: End Page Field: Image Snippet-->
                </div>

The post Sharepoint fields in page layout appeared first on Tech Musings - Anooj nair.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)