November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Hi,
I think you can set the StartPublish and/or StopPublish to make it "not available". Here's an example code:
Snippet
var content = CurrentContent.CreateWritableClone<EntryContentBase>(); content.StopPublish = DateTime.UtcNow.AddDays(-1); contentRepo.Save(content, SaveAction.Publish, AccessLevel.NoAccess);
Hi Quan!
Epi_IsPublished will still be true since you use SaveAction.Publish though. But maybe StartPublish and StopPublish will prevent it from showing?
There is no true way to unpublish a catalog content using content APIs (or at least what I know of). Setting StartPublish to be after current time means it's yet to available, while setting StopPublish to the past means it's expired. It then depends on your front-end code to filter out those entries from being shown.
You can still set IsActive column via CatalogEntryDto and/or setting metaObject["Epi_IsPublished"] to false via MetaObject.
/Q
Okay. I think in previous versions of EPi, I could set IsPendingPublish to true, which would set IsActive to false on the CatalogEntry. Is this still the case?
I would recommend to set the StopPublish to the current UTC time and that way expire the content.
It would require you to filter out content upon loading using the IPublishedStateAssessor.IsPublished function, but that is something you should already be doing. :)
Hi!
How can I unpublish a product without deleting it? Should I set it's status? And what SaveAction should I use?