Skip to content

IG in DC widget > templateName = "ImageGallery": Previous image and Next image links display images that are no part of Related images field #1283

@PepiIvanova

Description

@PepiIvanova
  1. Go to Module builder and create a module
  2. Add a field of type Related media > Images
  3. Click Continue to finalize configuring the field
  4. For Display selected items on the frontend using... select Custom from the dropdown
  5. 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
  6. Click Done
  7. Click Finish
  8. Activate the module
  9. Upload for example 5 images
  10. Go and create at least one dynamic content item from the newly created type
  11. Type the Title and select 2 images for Related images field
  12. 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"})

  1. Go to Pages and create a page
  2. D&D Dynamic content widget
  3. 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
  4. View the page and go in the details of the item
  5. Click one of the image
  6. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions