Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Custom control in custom page layout not getting shown

$
0
0

Hi,

I have created a site column for Date field:

<Field ID="{GUID}" Name="MyCustomPageLayoutDate" StaticName="MyCustomPageLayoutDate" Group="TestGroup" Type="DateTime" Format="DateOnly" DisplayName="Date" Required="FALSE" >

<Field ID ="{guid}" Name ="MyCustomLayoutDateDisplay" DisplayName="Date Display"
         Group="TestGroup"
         Type="Calculated"
         ResultType="Text"
         ReadOnly="TRUE"
         Required="FALSE">
    <Formula>=TEXT([Date],"MMMM dd, yyyy")</Formula>
  </Field>

This is added in the page layout content type:

<FieldRef ID="{guid}" Name="MyCustomPageLayoutDate" />

  <FieldRef ID="{guid}" Name ="MyCustomLayoutDateDisplay" />

In the custom page layout, it is added as below:

<Publishing:EditModePanel ID="EditModePanel5" runat="server" CssClass="edit-mode-panel"><tr><td>
                        Date</td></tr></Publishing:EditModePanel><PublishingWebControls:EditModePanel ID="DateEditModePanel" runat="server" PageDisplayMode="Edit" SupressTag="True"><tr><td ><PageFieldDateTimeField:DateTimeField ID="DateTimeField1" FieldName="GUID" runat="server"></PageFieldDateTimeField:DateTimeField></td></tr></PublishingWebControls:EditModePanel><PublishingWebControls:EditModePanel ID="DatePublishModePanel" PageDisplayMode="Display" runat="server"><tr><td><SharePoint:CalculatedField ID="CalculatedDateField" FieldName="guid" runat="server" /></td></tr></PublishingWebControls:EditModePanel>

In the edit mode, the date is getting shown, and I am able to select a date. When the page is published, the entered date is not getting displayed.

How to fix this?

Thanks



Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>