Hello,
How to identify programmatically whether new pages has been added at site collection level ?
Requirement is like to notify users as pop up that new content is added to site.
Any idea ?
Thanks and kind Regards,
Dipti
If you’re on SP 2013, I’d use the content by search web part and constrain it by the Pages content type, Sites, and return xx items and sort by a date field (created, modified etc.).
I’d build a blank page with only this said CSWP in the pages library.
On the home page I’d use the content editor to open a dialog which would display this blank page in a dialog. Â Here is some JS:
SP.UI.ModalDialog.showModalDialog({
url: “/Pages/RecentPages.aspx?lastupdate=” + lastUpdateParam,
title: “Recent Pages”,
width: 800,
height: 800,
dialogReturnValueCallback: callbackIfNecessary
});
If my CSWP returned 0 results I’d immediately close the dialog:Â window.frameElement.commonModalDialogClose(0);
Other notes:
1) Only display files once to users? Â Use a cookie to store the date time contents were retrieved. Â Add date time constraint from cookie by adding to CSWP query VIA UrlToken in dialog (can do this client side on home page).
2) Don’t automatically show a pop-up to users. Â It will probably annoy them. Â Should require at least a click from the user. Â Alternatively, don’t use a pop-up and just embed said CSWP on the home page – better user experience.
Happy SharePointing.
BTW – if you’re using SP2010 you could always go with Content By Query Web Part – albeit not as fast would work as a crude solution.