Display First Image in Gallery
I have added an Images related data field to my Custom Module.
I would like to display the first Image I have added to the Gallery. Is there a simple way to do this using the Image or Image Gallery control?
Hello David,
Thank you for using our service.
I would like to inform you that this case has been transferred to our Sitefinity Sales Engineers. They will get back to you as soon as possible.
Thank you for you patience.
Regards,
Stefani Tacheva
Telerik
Hi Stefani, I think this is because I downloaded the RealEstate Trial Demo - I think they thought I was new customer.
In regards to the question, I've discovered that if you just use a simple ImageControl then this appears to select the first image of the related data field. However, I'm not sure how to select the thumbnail rather than image using this control.
If the ImageControl cannot display the Thumbnail, I guess I'm going to have to use the ImageView, but filter the images shown based on a tag say ="First", in order to show just one image? I worry about how efficient this is?
Hi David,
Can you please try to set the ImageDisplayMode property of the ImageControl to Thumbnail or set the ThumbnailName attribute to one of the thumbnail size names under Administration->Settings->Thumbnails.
Here is a sample:
<
sf:ImageControl
runat
=
"server"
Title
=
""
UrlKeyPrefix
=
""
ProviderName
=
"OpenAccessDataProvider"
ImageDisplayMode
=
"Thumbnail"
>
<
RelatedDataDefinition
RelatedFieldName
=
"RelatedImageField"
RelatedItemType
=
"Telerik.Sitefinity.DynamicTypes.Model.MyModules.MyModule"
RelationTypeToDisplay
=
"Child"
RelatedItemSource
=
"DataItemContainer"
>
</
RelatedDataDefinition
>
</
sf:ImageControl
>
Thanks Sabrie,
Adding both ImageDisplayMode="Thumbnail" and ThumbnailName="small" did the job.