0

I'm creating page layouts in SharePoint 2013. I have added author field in page layout.But I have to display First And Last Name of Author.

<SharePoint:FormField ID="FormField1" ControlMode="Display" FieldName="Author" DisableInputFieldLabel="true" runat="server"/>

Also I have SharePoint Date-time control

<SharePointWebControls:DateTimeField FieldName="14aa28de-f5fa-48cc-8f8a-ac7d4a215136" runat="server"></SharePointWebControls:DateTimeField>

I'm trying to display custom date on page layout like May 11th 2017

Please suggest something

1

instead of adding SharePointWebControls:DateTimeField you can just render the code in-line

<%=SPContext.Current.ListItem["Created"] != null? (new DateTime(SPContext.Current.ListItem["Created"].ToString()).ToString("USE FORMAT DATE STRING HERE"): string.Empty %>

OR

Create a calculated column to store the date and render that field The formula for calculated column will be =TEXT(DATEFIELD,"DATEFORMAT")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.