Use related content items with widgets

Built-in widgets for modules supporting related data have a property RelatedDataDefinition of type RelatedDataDefinition. RelatedDataDefinition is a definition class containing all information needed to display related data items, including:

  • RelatedItemId, RelatedItemType, RelatedItemProviderName, and RelatedFieldName properties, which give information about the related item.
  • RelationTypeToDisplay, which determines the relation type of the items that will be displayed - child or parent. By default, child items are displayed. To display parent items, set the value of the property to Parent.
  • RelatedItemSource,which defines the type of source for resolving the related item. This property is of type RelatedItemSource and can have the following values: 
    • DataItemContainer - the related item is resolved from the current DataItemContainer.
    • URL - the related item is resolved from the URL.
    • NoAutomaticBinding - the related item is not automatically resolved. You must set RelatedItemId and RelatedItemProviderName manually.

The following code is an example of NewsView item with configured RelatedDataDefinition to display child items:

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?