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.
I have found the way to implement the approach by creating the site scoped feature as mentioned in below :
http://alexeydev.blogspot.ru/2011/11/list-event-receiver-and-feature-scope.html
Thank you for your time.
Regards,
Dipti
Hi Ajeet, Thanks to look for this thread,
However there are multiple sub sites in site collection and each having pages library and I need to identify new content availability for the below :
1) Existing pages library for existing sub sites in site collectionÂ
2) Pages library of new created sub site.
Any possibility to implement this way ?Â
Thanks and Regards,
I think, by using event receiver over document library (for site pages)
And from here you can show a dialog box to show your comments.