sitefinity

Unlock shared content blocks in Sitefinity API


I want to unlock shared content blocks using Sitefinity API, but it does not appear that the ContentItems returned by ContentManager's GetContent() method has any attribute related to locking like the PageManager has (LockedBy). Yet, the Sitefinity UI clearly shows content blocks that are locked by users. Is there a method I'm missing somewhere?


Solution

  • You can check if there is a Temp version for your content item and if so, then it means it is locked. You can get the locked By userId from the LastModifiedBy property of the Temp version.