Developer forum

Forum » Development » News are put into archive in my custom-module

News are put into archive in my custom-module


Reply
Hi everyone,

 I'm creating a news-item from a custom-module, but the news-item is put into the archive in the news-module. Why?

Here's the pseudo-code:

Dynamicweb.NewsV2.NewsItem item = new NewsItem();
item.Archive = false;
item.NewsActive = True;
item.Save();

There is some more stuff, but not important (I guess).
I've tried setting NewsActive to false too, but it doesn't make a difference in this case.

Some please get back asap :-)





Replies

 
Nicolai Høeg Pedersen
Reply
Try setting item.NewsArchive = false, and item.NewsActiveTo =  DateTime.Now.AddYears(10).

It is a setting in managemen center/modules/News that moves news items to archive when publishing ends.

 

You must be logged in to post in the forum