Home > SharePoint > Adding the last modified date on a publishing page

Adding the last modified date on a publishing page

 

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.

Advertisements
Categories: SharePoint Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: