Matthew McDermott, MVP

General ramblings from a SharePoint MVP about SharePoint and Microsoft technologies related to collaboration, web content management and productivity.

Add Editor and Modified to a Publishing Page

I have often been asked how to add the name of the person who updated a page and the date to the footer. This is the first time I have had to do it. Though it is not obvious there is a control that helps with the display of any list column. The control is ListItemProperty. So for “Modified By” and “Last Modified” the fields are “Editor” and “Modified” respectively.

Here is one way to add the Editor and Modified field to a MOSS Publishing Page. There are probably other techniques, but this one appears to work just fine.

<div>Footer:
<SharePointWebControls:ListItemProperty runat="server" id="ListItemProperty1" Property="Editor"/> on
<SharePointWebControls:ListItemProperty runat="server" id="ListItemProperty2" Property="Modified"/>
</div>

clip_image002

Posted by Matthew McDermott on Tuesday, 24 Jun 2008 12:47
7 Comments | Filed under: Web Publishing
Bookmark this post with:        

Comments

On 28 Jul 2008 02:06, Vinay said:

Thanks for the post. Can you let me know where I can find the complete list properties available for the ListItemProperty. We have a requirement to display the current page description and "description" property does not render any value.

On 30 Jul 2008 07:52, Matthew McDermott said:

Vinay, The properties will depend on your content type and the columns that you added to the library, no two lists will be the same. Description is a standard field, the trick is that the actual field name is "Comments" so this is how you would add it: |SharePointWebControls:NoteField FieldName="Comments" runat="server"|

On 17 Sep 2008 10:04, Kunal Patel said:

I have Announcements, Tasks web parts on my page.I want to display a "Last Modified Date" on my homepage if an administrator adds or deletes or edits any items in this web part..and also it should chage the modified date if user adds any links in the top and left navigation... Thanks in Advance.. I tried using your control but its returning me an "unexpected error" Can you tell me exactly how to use the control you are suggesting??

On 17 Sep 2008 10:07, Kunal said:

I tried using your control but its giving me an "unexpected error"..Can you tell me exactly how to use this control?? I just copied it to my default.aspx page... I have Announcemets and Tasks web parts on my home page...I need to display the "Last modified date " for both these web parts on my homepage...How can I do this??

On 18 Sep 2008 06:44, Matthew said:

Kunal, you are confusing Publishing (Pages) with Collaboration (Lists). If you want to display the contents of a list on a page, you need to use web parts. This article addresses how to display properties of the currently displayed page on a publishing site. If you want to display the last modified date in a web part, simply edit the web part View and add the Modified field. As for the navigation, I don't quite understand what you mean.

On 01 Oct 2008 08:03, Patrick Gaul said:

Matthew, I've got a situation where I'd like the footer to reflect the last date of any changes to a web part page which IS NOT a publishing page. We've got a big site collection with a number of default pages (not in a publishing pages library) that show no change in the last modified date when an administrator modifies the shared view of those pages (and the web parts in these pages have personalization disabled). Is there a way to get at the last modified date for individual web parts in a web part zone - for shared views of those web parts?

On 02 Oct 2008 07:15, Matthew said:

Patrick, have you tried using the modified field of the web part page? When you change the web part page that field is updated. I just tested it and it worked fine. Remember though that this will only reflect when the web part page is updated, not the content.

Leave a comment

Name (required)

Url

Email

Comments

Complete this section to post your comment