Social Share for Sitefinity News List Items

Social Share for Sitefinity News List Items

April 15, 2013 0 Comments

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.

When using the News module in Sitefinity CMS, one requirement is to be able to share a news item directly from the news list on the frontend. That way, users who find an item interesting by just reading the summary can easily share a link to the whole news item.

This can be achieved by creating a user control, for the template use the template of the list view, extend it via the codebehind to accommodate our requirement.

By default the template contains the social share placeholder container:  <asp:PlaceHolder ID="socialOptionsContainer" runat="server" />

First we need to hook to NewsList_ItemDatabound. After that we have access to all the information to successfully populate the social share information. We need a Title and a URL to share. The URL we share will be the one from the DetailsViewHyperlink. That way when a user on Facebook clicks it, they will be taken to the full news story.

Once we have all the necessary information, we create a new RadSocialShare and add the Title and Link to share.

Once we are done, all we need to do is place a News widget on the page and replace the NewsList template by clicking on Edit -> Advanced->ControlDefinition->Views->NewsFrontendList and in TemplatePath add the path to our modified template:



If everything is working, the end result will be this:



Here is the sample, ready for use and customization: NewsSocialShare
progress-logo

The Progress Team

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.

Comments
Comments are disabled in preview mode.
Topics
Latest Stories
in Your Inbox

Subscribe to get all the news, info and tutorials you need to build better business apps and sites

Sitefinity Training and Certification Now Available.

Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.

Learn More
More From Progress
570x321_ResourceImage_RITM0089185
See What's New in Sitefinity 13.3
Read More
 
232x131_ResourceImage
Creating Epic Digital Experiences for B2B Companies
Read More
 
dev_thumb370x200
Five Reasons Why Developers Love Sitefinity Marketplace
Read More