Display First Image in Gallery

Posted by Community Admin on 04-Aug-2018 16:03

Display First Image in Gallery

All Replies

Posted by Community Admin on 15-Jun-2015 00:00

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?

Posted by Community Admin on 16-Jun-2015 00:00

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

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 18-Jun-2015 00:00

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?

Posted by Community Admin on 23-Jun-2015 00:00

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>

Regards,
Sabrie Nedzhip
Telerik
 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 23-Jun-2015 00:00

Thanks Sabrie,

Adding both ImageDisplayMode="Thumbnail" and ThumbnailName="small" did the job.

This thread is closed