Archive for February, 2013

Adding the last modified date on a publishing page

February 6, 2013 Leave a comment


A comment requirement for corporations is to display the modified date of a publishing page on the actual page itself.  The way we do this is to add a placeholder on the master page that we populate in the page layout.

To add the field, use the following code:

<SharePointWebControls:DateTimeField id="pageContentUpdate" FieldName="Modified" runat="server"/>

I highlighted the field type DateTimeField, because you can actually display the field using the standard FieldValue type as follows:

<SharePointWebControls:FieldValue id="pageContentUpdate" FieldName="Modified" runat="server"/>

This worked great, until I realized the time displayed on the page layout was 5 hours behind the actual modified date Disappointed smile.

Categories: SharePoint Tags: