Question

I have some migrated Wiki pages from 2007 that are no longer showing their Last Modified Date in the footer. Is this not included Out of Box anymore? I can see the modified date in 'Page History' but not the Wiki page itself.

In the 2007 Page Layout there was this working tag:

<span id="ctl00_PlaceHolderMain_ctl02"></span>

I also tried writing the following REST query but it returns the wrong user. It shows myself even though the ModifiedBy field is a different user.

/WIKI/_api/web/getfilebyserverrelativeurl('/WIKI/Wiki Pages/Home.aspx')?$select=TimeLastModified,ModifiedBy/Title,ModifiedBy/LoginName&$expand=ModifiedBy

Any suggestions on getting the Last Modified Date to display in Wiki Pages?

Was it helpful?

Solution

You can try the following example to get the Last Modified and Last Modified by Field for a page

// Get Item ID of the Page in the Document LIbrary
var sItemId = _spPageContextInfo.pageItemId;
if (sItemId != "" && sItemId != "0") 
{
    // Get GUID of the document library where the page is stored
    var spageListId = _spPageContextInfo.pageListId;
    sPageListId = spageListId.replace("{", "'");
    sPageListId = spageListId.replace("}", "'");
    // Form the REST URL to get the Last Modified and Last Modified By Information
    var sRestApiRequestUrl = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists(guid" + sPageListId + ")/items(" + sItemId + ")?$select=Modified,ID,Title,Editor/Id,Editor/Title,Editor/EMail,*&$expand=Editor";
}
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top