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.

Web Security for Sitefinity Administrators

The free standalone Web Security lesson teaches administrators how to protect your websites and Sitefinity instance from external threats. Learn to 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?