- Go to Module builder and create a module
- Add a field of type Related media > Images
- Click Continue to finalize configuring the field
- For Display selected items on the frontend using... select Custom from the dropdown
- In the Type or Virtual path of the custom widget textbox enter the full type name of the Image gallery controller: Telerik.Sitefinity.Frontend.Media.Mvc.Controllers.ImageGalleryController, Telerik.Sitefinity.Frontend.Media
- Click Done
- Click Finish
- Activate the module
- Go and create at least one dynamic content item from the newly created type
- Type the Title and select 5 images for Related images field
- Change the templateName and list settings of the Image gallery in Dynamic Content detail template from Sitefinity's administration panel -> Design -> Widget templates and open the Detail.[Name of your type]
@Html.Action("RelatedData",
"ImageGallery",
new {relatedItem = Model.Item.DataItem,
relatedDataViewModel = new RelatedDataViewModel()
{
RelatedItemType = "Telerik.Sitefinity.DynamicTypes.Model.MyModule.MyType",
RelatedFieldName= "MyRelatedImages",
RelationTypeToDisplay = "Child"
},
templateName="ImageGallery",
settingsViewModel = new ImageGallerySettingsViewModel()
{
ItemsPerPage = 2
}})
- Go to Pages and create a page
- D&D Dynamic content widget
- View the page and go in the details of the item
Result
2 pages are displayed instead of 3.
@Html.Action("RelatedData",
"ImageGallery",
new {relatedItem = Model.Item.DataItem,
relatedDataViewModel = new RelatedDataViewModel()
{
RelatedItemType = "Telerik.Sitefinity.DynamicTypes.Model.MyModule.MyType",
RelatedFieldName= "MyRelatedImages",
RelationTypeToDisplay = "Child"
},
templateName="ImageGallery",
settingsViewModel = new ImageGallerySettingsViewModel()
{
ItemsPerPage = 2
}})
Result
2 pages are displayed instead of 3.