Developer forum

Forum » Development » Getting NewsItems with the Newsv2 namespace

Getting NewsItems with the Newsv2 namespace


Reply

I am creating a XMLReader module for our news to port the news to another site.

Currently i am getting the news like this:

 

...

private string GetNewsByIds(int[] news)
{

    foreach(int id in news)

    {

        Dynamicweb.NewsV2.NewsItem item =

        new Dynamicweb.NewsV2.NewsItem(id);

    }

}

...

My question is:

How do I get the newsitems in a more flexible fashion?

If I for example want to retrieve the top 5 newst news in a specific categoryhow would I go about doing that?

I can see there is a NewsItemCollection Object but no apparent way to fill it?

 

kind regards

Sune Fengel

 

 


Replies

 
Reply

The easiest way to acheive this that I can think of would be to setup a page that contains XML in master-, page-, paragraph-, and module template and set up the module to display top 5 news on the paragraph. Wouldn't that do the trick for you?

 
Reply
Sorensen wrote:

The easiest way to acheive this that I can think of would be to setup a page that contains XML in master-, page-, paragraph-, and module template and set up the module to display top 5 news on the paragraph. Wouldn't that do the trick for you?

I guess I could do it that way.

Just wanted to check if tehre was a programmatic approach as tthere is to the Forum.

 

thanks

 
Reply

I always like to go as far as possible without having to do any programing to avoid the need for programmers - sorry guys;)

 

Ok, my point here is to enable the customer to affect the usage of the functionality at a later state without having to do any coding. But if it doesn't work out, let's brew an other solution together.

 

You must be logged in to post in the forum