Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: Adding Data Pulbished

$
0
0
The documentation is not clear on it, anyways I use the following code:
using (DataConnection conn = new DataConnection(PublicationScope.Unpublished)) 
{
    var item = conn.CreateNew<Custom.DataFolder>();
    item.Id = Guid.NewGuid();
        item.PageId = CurrentPageNode.Id;
        item.PublicationStatus = "published";
    //other props               
    conn.Add<Custom.DataFolder>(item);
}
I expect the new item to be added and published. But for some reason this doesn't fill the " "_Published.xml" of my datatype.

So I ended up adding the item in both scopes, when directly punblished. Is this Correct?

Also when an Item IsPublished, How do I remove it again. Delete in unpublished scope works fine. But deleting the same item in published scope (just like I do with insert) gives an error about a non existing dataSourceIds.

Viewing all articles
Browse latest Browse all 2540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>