Filter dynamic content items by related data
Similar to filtering the related data items for standard widgets, dynamic MVC widgets also support filtering by related data items.
PREREQUISITES: You have added Related data custom field of type News to the Cities dynamic content type and name the field CityGuide.
Perform the following:
- Create new page with name RelatedData that uses the Bootstrap.default template.
- Drag the News MVC widget on the page.
- Drag the Cities MVC widget on the page.
- Click the Edit button of the Cities MVC widget.
- Click Advanced » Model.
- Set the following related data properties:
This is the name of the related data field.
This is the full type name of the related data field.
This is the relation type that specifies whether related items are children or parents of the source item.
This is the name of the provider that the related data uses.
- Click Save, publish the page, and open it on the frontend.
You will see all cities and all news items on the page.
- Click on a news item.
As a result, you will be navigated to the Detail view of the news item and cities will be filtered so that only those, which the news item is related to, are being displayed.