Deliver superior customer experiences with an AI-driven platform for creating and deploying cognitive chatbots
Deliver Awesome UI with the most complete toolboxes for .NET, Web and Mobile development
Automate UI, load and performance testing for web, desktop and mobile
A complete cloud platform for an app or your entire digital business
Detect and predict anomalies by automating machine learning to achieve higher asset uptime and maximized yield
Automate decision processes with a no-code business rules engine
Optimize data integration with high-performance connectivity
Connect to any cloud or on-premises data source using a standard interface
Build engaging multi-channel web and digital experiences with intuitive web content management
Personalize and optimize the customer experience across digital touchpoints
Build, protect and deploy apps across any platform and mobile device
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.
Sitefinity in its current version comes with two built-in settings: TextSetting and ContentSetting. In the previous post I’ve explained the TextSetting control and in this one we will explore ContentSetting.
Before I dig into the details, the first question that ought to be answered is why use different settings. The answer is quite simple: they control their targets in different manner. TextSetting is the most rudimentary setting which controls the visibility, label and format of its target control. ContentSetting is a bit more advanced setting, which generally (though its not a rule) controls a target which displays a full content of generic content item (news, post, event…).
Adding a ContentSetting to the designer is no different than adding the TextSetting. You simply have to open the designer template and declare the control inside of the Master od Detail settings collection of the given presentation mode. If you wish to see an example of this, you can open the following file in your Sitefinity installation:
and scroll down to the MasterSettings collection od the ModeSettings1 control. You will find ContentSetting control there declared as follows:
As you can see ContentSetting control needs only two properties to be set:
In the previous post, we’ve seen that the appearance of the TextSetting control largely depends on the value of its properties. ContentSetting control, on the other hand, always looks the same. Take a look at Figure 1 to see how can you recognize a ContentSetting control in your designer.
Figure 1: Two modes of ContentSetting control
Admittedly, this section should have been closer to the beginning of the post, but better late than never. ContentSetting control has a purpose of dynamic creation of summaries. Let’s imagine that we want to display a list of blog posts. By implementing a ContentSetting control on the “content” or “post” target control, which is bound to the full text of the post, we can easily open the designer and switch to the summary mode where we can define how do we want the summary to be created. We can limit the number of words that we want to display, as well as perform html stripping. In case we want to display the full post with all HTML, we can just switch back to the content mode.
Now that we have covered the two built in settings, in the next post, we’ll do something more exciting. We are going to create our own custom setting control. Then in the posts to follow, we’ll explore presentation modes and how to extend those and for the grand finale - we are going to build a whole custom content view designer.
If you have any questions or suggestions, please leave a comment.
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.
Copyright © 2018 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.