The content you're reading is getting on in years
This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.
In this blog post I will share with you a specific Sitefinity use case and how to go about it.
“As a website administrators I want to have 3 different News modules just like the built-in Sitefinity News module because we have 3 different news authors who should have access to manage only their own news section.”
Make use of the Sitefinity provider model to create a total of 3 providers for the News module and set permissions for each news provider respectively.
News module providers can be created entirely through the Sitefinity admin interface in just 5 steps:
Login to Sitefinity CMS and go to Administration -> Settings -> Advanced settings
Locate News in the left panel and go to News -> Providers, then click on the Create new button in the right panel and fill the new provider properties
sample values:
Name: CommunityNews
Title: Community News
Description: News about our user community.
Provider type: Telerik.Sitefinity.Modules.News.Data.OpenAccessNewsProvider
Make sure you check the Enable checkbox before saving the changes.
Select the newly created provider from the left panel and add an application name parameter for it
Sample values:
Key: applicationName
Value: /CommunityNews
Repeat the steps to add one more provider with a different name (e.g. ProductNews) and different value for its applicationName parameter (e.g. /ProductNews)
Restart the website from the IIS web server for the changes to take effect. That's it!
You now have 3 different News providers that store news data in the same Sitefinity database and it is possible to assign permissions for each provider. The news data can also be manipulated through the API.
Let’s go to Content Types -> News to see our providers and create one news article under the CommunityNews provider.
Only users who have access to the CommunityNews provider will be able to manage this newly created article. You can set permissions for your issues by going to the Permissions link in the right panel of the screen above and selecting the respective provider to set its permissions.
News articles for different News providers can be displayed on Sitefinity pages utilizing the built-in News widget and all its features. To display our community news article on a page, you should add the News widget onto that page, click Edit and go to its advanced properties (bottom right corner of the edit dialog) and then go to the ControlDefinition button to update the ProviderName property of the widget with the name of the desired News provider.
The news widget will then display only news articles from the specified News module data provider. You can also leverage all its features such classification filters, sorting, paging, custom widget templates, and much more.
If you create custom fields for the News content type in general, these custom fields will be applied across all providers. But if all custom fields are the same for all news providers then this approach is perfect for our user story. In case you want to have different custom fields for the 3 different news sections, then you should develop a new content type for the two additional News module.
The provider approach is a very quick and easy way to separate and delegate News management to different stakeholders of the website. You don’t need to write a single line of code to do it.
What do you think about this approach? How do you find its use?
View all posts from The Progress Team on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.
Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.
Learn MoreSubscribe to get all the news, info and tutorials you need to build better business apps and sites
Progress collects the Personal Information set out in our Privacy Policy and the Supplemental Privacy notice for residents of California and other US States and uses it for the purposes stated in that policy.
You can also ask us not to share your Personal Information to third parties here: Do Not Sell or Share My Info
We see that you have already chosen to receive marketing materials from us. If you wish to change this at any time you may do so by clicking here.
Thank you for your continued interest in Progress. Based on either your previous activity on our websites or our ongoing relationship, we will keep you updated on our products, solutions, services, company news and events. If you decide that you want to be removed from our mailing lists at any time, you can change your contact preferences by clicking here.