Finding all documents that have been saved but not published (has pending changes)
I have a requirement from a customer to create them a dashboard that lists the latest edits on the site.
So I pointed them at the latest edits dashboard, however they want something a bit more featured.
Specifically they want to show all pending changes, documents / pages that have been edited and saved but not published.
They also want to show all pages that have been sent to publish.
Doing a little research I can see that the Document class on v4 has something I may be able to use .HasPendingChanges but I can't find an equivalent on the Document API.
Does anyone know of something that would do the same in v7?
Have a look at the Obselete attribute on that method. It says you should just check if the latest version of the content is published. You'll be able to get the latest version using the ContentService in Umbraco 7.
This could be extremely slow over a large number of nodes though. There might be some way you can leverage the internal index which I believe indexes unpublished content as well as published.
On a side note I've also seen theres a new dashboard for 7 which shows unpublished content call "The Dashboard". I couldn't get it to work on 7.2.5 but the source code is available so I'll be seeing how they are pulling in the unpublished nodes.
Finding all documents that have been saved but not published (has pending changes)
I have a requirement from a customer to create them a dashboard that lists the latest edits on the site.
So I pointed them at the latest edits dashboard, however they want something a bit more featured.
Specifically they want to show all pending changes, documents / pages that have been edited and saved but not published.
They also want to show all pages that have been sent to publish.
Doing a little research I can see that the Document class on v4 has something I may be able to use .HasPendingChanges but I can't find an equivalent on the Document API.
Does anyone know of something that would do the same in v7?
Hi Mike,
Have a look at the Obselete attribute on that method. It says you should just check if the latest version of the content is published. You'll be able to get the latest version using the ContentService in Umbraco 7.
This could be extremely slow over a large number of nodes though. There might be some way you can leverage the internal index which I believe indexes unpublished content as well as published.
Thanks Steven, good spot. I'll give it ago.
On a side note I've also seen theres a new dashboard for 7 which shows unpublished content call "The Dashboard". I couldn't get it to work on 7.2.5 but the source code is available so I'll be seeing how they are pulling in the unpublished nodes.
is working on a reply...