I think I may have a solution to this misunderstanding. Nikifor correctly pointed out that we don’t offer this functionality out of the box, but as far as I understand, you’d like some elaboration on how to do that yourself.
When working with Sitefinity modules, or any other part of Sitefinity for that matter, you should use our API, in other words appropriate manager class. The naming convention of these classes is ModuleName + "Manager", so for news you should create a new instance of NewsManager class.
All of the manager classes have overloaded constructors, which means that you can instantiate them with or without provider name. So new NewsManager()
would be instantiated with default provider, and new NewsManager(string providerName)
with the provider whose name is supplied.
Generally speaking, manager classes have methods and functions which you can easily explore through IntelliSense and their naming conventions are self explanatory. A peculiarity of the Generic Content based modules (Generic Content, News, Blogs in 3.1, and Photos & Documents, Newsletter and Events starting in 3.2) is that for most of the content management they use their base Content manager. That, however, you can easily access through Content property.
To illustrate this, let me give you a simple example:
|// create new instance of news manager with default provider |
| Telerik.News.NewsManager newsManager = new Telerik.News.NewsManager(); |
| // create new content |
| Telerik.Cms.Engine.IContent submittedNews = newsManager.Content.CreateContent("text/html"); |
| // set any meta data for the content you wish to set |
| submittedNews.SetMetaData("Title", "Submitted news title"); |
| // set the actual content |
| submittedNews.Content = "Text of the news"; |
| // save the content with news manager and you are done |
| newsManager.Content.SaveContent(submittedNews); |
There is also a video which explains a scenario very similar to yours. The video explains how to add a public control for adding new blogs and I even explain news manager briefly, so you may want to take a look at that : http://www.sitefinity.com/Videos/Working_With_Sitefinity_API/
In addition to this, since you are interested in News module which is a Generic Content based module, you may want to check out these two posts (C# and VB.NET samples):http://blogs.sitefinity.com/Ivan/Post/07-12-20/sitefinity_intra-site_modules_the_unbearable_lightness_of_development.aspxhttp://blogs.sitefinity.com/Ivan/Post/08-01-16/sitefinity_intra-site_modules_with_visual_basic_net_the_even_more_unbearable_lightness_of_development.aspx
I hope I've understood your question correctly and that you will find this answer helpful.