SaaS CMS has officially launched! Learn more now.

How to get Recently Changed Pages and Blocks for currentUser


Hi, i am trying to read how to get Recently Changed Content items like pages and blocks to be displayed on a widget. (i know there s a already a recently changed widget available by this is little customized)

After reading this,, i thought life would be easy but i count find the class RecentlyChangedPage . any help!

Jun 29, 2018 10:50


I think you'd need the activity query service for something like that. You get an instance of IActivityQueryService and call "ListActivitiesAsync" passing in a query for the activities you're after. Here's an example:

var aqs = ServiceLocator.Current.GetInstance<IActivityQueryService>();
var query = new ActivityQuery
    ChangedBy = "admin",
    ActivityType = "Content",
    MaxResults = 10,
    Order = ActivityOrder.LatestFirst
var activities = await aqs.ListActivitiesAsync(query);

You can also provide an action to the ActivityQuery if you want to be more specific about the activities to list.

Jul 03, 2018 15:13

Thanks Paul

But this query does not list out content items that are "Saved" by user. It only list out "Published" and "created" activities. I tried to see if it read saved activities by adding "Action = 4 " in the above activity query but i got no result. 

Jul 03, 2018 16:10

If you want to log the Save event, you'll need to enable that in config by adding enableLogOfContentSave="true" to the <applicationSettings> node inside <episerver> in your web.config. Be warned though, that event gets called automatically as you're editing so expect to get a high volume of records returned. 

Jul 03, 2018 17:10

There is a report ("Changed Pages") in admin/reports mode that does the same (kind-of) thing. Try reflecting that and you should be able to find out the API. I did the same in the past but can't remember the api but it is same API.

Jul 03, 2018 17:16

Hey Paul, any way to filter away "delete" activities? 

Jul 17, 2018 16:26

You can filter your results to a specific action and/or activity type but if you'd like to return all activities except "delete" ones then I think you'd need to get all activities and filter out the delete ones yourself:

var filteredActivities = activities.Where(x => !x.Action.Equals((int)ContentActionType.Delete));
Jul 17, 2018 19:06

Thanks Paul

Jul 18, 2018 9:33

Can enabling log of content save make the site slow? our client recenly complained that a block takes 8-9 mins to change display (right, left, down etc) from CMS. can this be due to enablingLogOfContentSave=true in web.config? 

Oct 31, 2018 9:55

It's certainly not going to help. As I mentioned above, when you enable the logging of save events you'll be logging considerably more events than you were previously as the save event is called pretty much constantly as the editors edit the pages so it's quite easy for the volume of that data to get out of hand which, depending how it's used, may have a knock-on effect on the performance of the site.

That said, 8-9 minutes sounds like a long time for a request to be delayed. I'd expect the request or DB connection to have timed out long before that. Is that 8-9 mins between making a change and the on-page editor reflecting that change or is it 8-9 minutes between a change being made and that change showing up on the website?

Oct 31, 2018 14:18
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.