With Sharepoint 2013 I wanted an easy way to list of the pages in my masterpage galery that haven’t been published yet.
You first need to Create a new view named Unpublished Content. You can sort by Name, and scroll down to the Folders settings and choose Show all items without folders.
We now have all our files in the view.
Next, switch to the Library ribbon and choose Modify in SharePoint Designer (Advanced) from the Modify View dropdown.
Sharepoint Designer will open your page.
In Sharepoint Designer, switch to the Home tab and choose Advanced Mode. The file is reloaded.
Search into your code the tag ListViewXml. On this line you should have <Query;&>. Just after it, we need to add:
<Where><Or><Eq><FieldRef Name="_ModerationStatus" /><Value Type="ModStat">Draft</Value></Eq><IsNotNull><FieldRef Name="CheckoutUser" /></IsNotNull></Or></Where>
Before:
After:
(click to enlarge)
Save, and your view should only show the unpublished content!
(Article inspired by https://thechriskent.com/2013/02/14/unpublished-view/)