IMPORTANT: This version of Sitefinity CMS is out of support and the respective product documentation is no longer maintained and can be outdated. Use the version selector to view a supported product version.
You add relations between content types by adding Related data custom fields. The custom fields can then be used to create relation between the items of the specified types.
The following example demonstrates how to add related data to a News widget that displays News widget to display News items' content. You want to also display related news. For example, if the news content is about the latest Sitefinity CMS release, you may also want to display links to related news about new features or previous releases.
You do this by creating a page where you drop the News widget. You create a custom field RelatedNews of type Related data. In the backend, when you create a news item, you see the custom field added and you can choose from a list of news items to be related to the news item you are creating. Then, you add the RelatedNews field to the widget template of the News widget. When you open the site and click a news item, you will see the details of the news item and the link to the related news.
For more information about creating widget templates, see Feather: Modify widget templates.
To add a related data custom field to the News items:
To display the related news links:
SitefinityWebApp/Mvc/Views/News
Detail.DetailPageRelatedData.cshtml
Back To Top
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important