Out of the box dynamic content widgets provide you with intuitive helper methods for working with hierarchical content types. Using these simple helper methods, you can display the parent and child items of the hierarchical content types in the widget views.
To access the child items of dynamic content object, you use the ChildItems helper method inside the detail templates of the widget.
NOTE: The ChildItems helper method works only with dynamic content types that have parent-child hierarchy structure, and the Model is of type ItemViewModel. If you are using a custom widget to display the dynamic content items, make sure your Model inherits from Telerik.Sitefinity.Frontend.Mvc.Models.ItemViewModel.
This method returns a collection of the ItemViewModel type. As a result, you can access the properties of the child items using the following code:
NOTE: Keep in mind that a parent item may have numerous child items, whereas child items have just one parent item. Consequently, in the code above, you need to specify the ChildType1 since there may be more than one child types.
To access the parent item of dynamic content object, you use the following helper method inside the detail templates of the widget:
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
Copyright © 2023 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.
Progress, Telerik, Ipswitch, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.
Powered by Progress Sitefinity