Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
I'm looking for the right way for editing and publishing a content node from code. I can edit it, but how to publish?
Here is the simple part that does saving...but not publishing.
public bool EditContent(Content content, Dictionary<string, string> contentProperties) { Content activeContent = Hive.QueryContent().Single(x => x.Id == content.Id);
foreach (var contentProperty in contentProperties) { if (activeContent.Attributes.Contains(contentProperty.Key)) { activeContent.Attributes[contentProperty.Key].DynamicValue = contentProperty.Value; } }
using (var writer = Hive.OpenWriter<IContentStore>()) { writer.Repositories.AddOrUpdate(activeContent); writer.Complete(); }
return true; }
Can anyone help me doing this "simple" action?
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Edit and publish existing Content node in Code with U5
Hi,
I'm looking for the right way for editing and publishing a content node from code. I can edit it, but how to publish?
Here is the simple part that does saving...but not publishing.
public bool EditContent(Content content, Dictionary<string, string> contentProperties)
{
Content activeContent = Hive.QueryContent().Single(x => x.Id == content.Id);
foreach (var contentProperty in contentProperties)
{
if (activeContent.Attributes.Contains(contentProperty.Key))
{
activeContent.Attributes[contentProperty.Key].DynamicValue = contentProperty.Value;
}
}
using (var writer = Hive.OpenWriter<IContentStore>())
{
writer.Repositories.AddOrUpdate(activeContent);
writer.Complete();
}
return true;
}
Can anyone help me doing this "simple" action?
is working on a reply...