1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / What's sf_CmsContentVersion.StatusLoc do?

What's sf_CmsContentVersion.StatusLoc do?

3 posts, 1 answered
  1. Connections Academy Developer
    Connections Academy Developer avatar
    151 posts
    Registered:
    04 May 2005
    05 Feb 2010
    Link to this post
    What's sf_CmsContentVersion.StatusLoc do? I'm trying to find a definitive way to see if a blog post has ever been published, and I see that once I publish it for the first time, the value goes from 0 to 1. When I make it a draft again, the StatusLoc value stays 1.

    declare @idBlog varchar(50)
     
    select @idBlog = id from sf_blogs --We only have one blog, so this grabs the GUID
     
    select sf_CmsContentBase.Url, sf_CmsContentVersion.*
    from sf_CmsContentVersion join sf_CmsContentBase
    on sf_cmscontentversion.ID = sf_CmsContentBase.ID
    and sf_CmsContentBase.ParentID = @idBlog

    My theory is that if a blog post's sf_CmsContentVersion.StatusLoc value is 0, it's never been published. If it's one, then at some point, it's been published. Am I correct?
  2. Connections Academy Developer
    Connections Academy Developer avatar
    151 posts
    Registered:
    04 May 2005
    05 Feb 2010
    Link to this post
    Also, does StatusLoc map to the Status member of IContent? If so, I think that means I'm right and I can use StatusLoc.

    (Side question -- one of the statuses is "archive." How do I do that?)
  3. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    08 Feb 2010
    Link to this post
    Hi Connections Academy Developer,

    Thank you for using our services.

    When you have Workflow for the Blogs module enabled the content items in the module will have three statuses (Draft, Published, Archived). The StatusLoc column in the table that you are referencing is holding this value. When an items is created and saved (but not published) this will have status Draft (0). Then when you publish the item it will have status 1 (Published). The archived status is reserved for future implementation. However is you for example use the bellow code:
    ContentManager cntManager = new ContentManager("Blogs");
    IContent blogItem = cntManager.GetContent(new Guid("1b72a8ee-5e44-4c6c-9157-9369a8720a82"));
    blogItem.Status = ContentStatus.Archived;
    cntManager.SaveContent(blogItem);

    It will set the StatusLoc value of this particular content item with status 2.

    Greetings,
    Radoslav Georgiev
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
    Answered
Register for webinar
3 posts, 1 answered