Sitefinity CMS

News API Overview Send comments on this topic.
See Also
Developing with Sitefinity > Modules > Modules API > Generic Content Based Modules > News > News API Overview

Glossary Item Box

The News module allows users to easily create and manage news items. The News module provides the NewsView public control which displays news. This topic provides information of how to use the NewsManager class.

 

The News module is based on Generic Content. All methods used by NewsManager are actually methods of the ContentManager class. 

For more information on the ContentManager class, see Generic Content API Overview of Generic Content API.

 

The Content property of the NewsManager class is the instance of ContentManager instantiated with a proper provider for News. While all Generic Content based modules (such as Blogs, Events, News, and so on) are using the ContentManager class for most of their data-related work, it is necessary that ContentManager is instantiated through the respective module's Content property, and not directly through ContentManager's constructor.

 

How to Start Using the NewsManager Class

You can create a new instance of the NewsManager class anywhere in your code in order to work with News module data. If working in an assembly, make sure you reference the Telerik.News assembly before you use the NewsManager class.


In order to start using News module API, create a new instance of the NewsManager class: 

Create a new instance of NewsManager with specified provider name:

Copy Code
// creates new instance of NewsManager class with provider name as parameter,
// which means that NewsManager will use specified provider when working with data
Telerik.Forums.NewsManager newsManager = new Telerik.Forums.NewsManager("MyCustomProvider");

See Also