Question

We are using a publishing Pages library with versioning and required checkout. When an editor makes changes to the page it is checked out and they get a warning at the top of the page that it is checked out to them.

enter image description here

However if another editor comes to the page they don't get any alert and if they select Edit from the menu it "pretends" to edit the page, but it won't really allow them to edit or save.

They could go to the Pages library and see that it is checked out, but it would be nice for editors to see from the page itself.

Is there something we can add to the page layout or masterpage that will show checked out/published status to editor/full control folks, but not show to read only folks?

I'm not having much luck searching for this because all the results just cover the basics of checking in/out and publishing.

Was it helpful?

Solution

We did this in the page layout and styled with css. Get the user page field CheckoutUser by creating a user field snippet, changing the field name, and adding it to the page layout. Once it's in the layout you can add any styling you need to get what you want.

We also wrapped the field span in a SecurityTrimmedAdministrators div created in the snippet editor to only show the field to users with editing permissions.

Note when no one has checked out the page it returns a non-breaking space &nbsp\;, which will take up vertical space in the layout unless you set the line-height and font-size to 0 for your main container.

If a page is checked out you can style the elements that are created inside your main container. We added this to preface the user name with "Checked out to:"

.checked-out > nobr:before { content: "Checked out to: "; }

OTHER TIPS

There are a couple ways to do this with javascript. You can check the Pages field value for Checked Out To and if its not empty, then the page is checked out.

You could also use this solution for checking the page's SP.File.checkOutType property with a REST or CSOM call: how to determine if a page is checked out? Client side, using javascript?

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top