- 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
- Upload for example 5 images
- Go and create at least one dynamic content item from the newly created type
- Type the Title and select 2 images for Related images field
- Change the templateName 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"})
- Go to Pages and create a page
- D&D Dynamic content widget
- D&D Image gallery widget and filter the images in a such way that no images are displayed. For example choose From selected libraries only... without selecting any library
- View the page and go in the details of the item
- Click one of the image
- Start clicking on Previous image and Next image links. Also, Back to all images link redirects to the list of dynamic content items.
Result
Images that are not part of Related images field are displayed
Wodkaround
Create a custom template for the details of Image gallery widget and remove Previous image, Next image and Back to all images links
@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"})
Result
Images that are not part of Related images field are displayed
Wodkaround
Create a custom template for the details of Image gallery widget and remove Previous image, Next image and Back to all images links