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
Rapidly develop, manage and deploy business apps, delivered as SaaS in the cloud
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.
By default our blog posts do not have “Read more” and “Read less” functions. If you want to show only a snippet of each blog post on the main page and have the link “Read more” for users to click and read the rest of the blog post and then have the ability to click “Read less” to see again the snippet of the blog post you need to follow the steps below in order to implement these functions:
1. Go to the Sitefinity backend of your project.
2. Go to the page where you want to display the blog posts.
3. Drag and drop a blog posts widget.
4. Click Edit button in the upper-right corner of the widget.
5. Select List Settings.
6. From the drop-down menu of List templates select Titles and dates.
7. Click Edit the template.
8. Add an import statement to register a SummaryParser's namespace:
<%@ Import Namespace="Telerik.Sitefinity.Data.Summary" %>
9. Add the following source code in the template under the closing div tag </div>:
Value='<%# SummaryParser.GetSummary(Eval("Content").ToString(),new SummarySettings(SummaryMode.Words,20,false,false)) %>'/>
Value='<%# Eval("Content")%>' style="display:none" CssClass="TestClass2"/>
You can change the value of the SummaryParser if you want to display more or less than 20 words. More information connected to the SummaryParser can be found in this blog post. Summary Settings allows you to cut of the first N words from the content item's content or other meta field.
In the template we have add two content fields. At the begging the first one is the summary content which is visible and the second one is the full content which is invisible. After clicking Read More link the first content will become invisible and the full content will be displayed on the page. Then the link Read More will become invisible and the Read Less link will appear on the page. If you click the Read Less link the full content of the blog post will disappear and the summary content will be displayed.
Please note that the java script should be included Where the widget is dropped.
I have recorded a video demonstrating how these functions works:
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.