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.
Each ContentView based control represents content items that have been created from the backend or programmatically. The ContentView based control has two modes
Build-in ContentView based controls are - EventsView, BlogPosts, NewsView, ContentView control, ImageGalley, DownloadList. The last two controls are ContentView based, but they have different presentation modes, because they are supposed to show data from Images and Documents module.
For each ContentView control you can enable comments. Enabling comments can be done through the control's Advanced/Properties tab where you will find Comments section. Once you have enabled the comments you may need to protect the form from online spammers. By default, SpamProtection is not enabled on Sitefinity comment. There is no public property that you can use to do this. Since 3.6 Sitefinity uses embedded templates, so first you need to map external template - ListPageDetails.ascx, then you need to find the SpamPropector declaration at the bottom of the template and enable SpamProtector control. You can save all these steps by creating a simple control that inherits from one of the ContentView based control and expose an user friendly public property. Then you only have to use this control instead of the built-in and set the custom property from the control designer.
1. Create a custom control that inherits from BlogPosts( or another ContentView based control).
2. Override SingleItemTemplatePath and ItemListTemplatePath properties where you need to set the path to external templates that the control will use in List and Details mode.
3. Create a ViewState property of Boolean type (true/false) that you will use in the control designer. You can set Category and Description of this property, so that you can find it easily under Advanced/Properties tab. All properties that do not have Category set are added under Misc section.
4. Crete a control references to RadEditor and SpamPropector controls. You can find the controls from the control's SingleContainer.
5. Override CreateSingleContent method, set the RadEditor as visible and check the value of the custom property - ShowCaptcha.
BlogPostsCustomControl : BlogPosts
obj = ViewState[
] = value;
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.
Subscribe to get all the news, info and tutorials you need to build better business apps and sites
Copyright © 2019 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.
Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.