+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Display First Image in Gallery

Display First Image in Gallery

5 posts, 0 answered
  1. David
    David avatar
    114 posts
    Registered:
    19 Jul 2012
    15 Jun 2015
    Link to this post

    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?

  2. Stefani Tacheva
    Stefani Tacheva avatar
    718 posts
    Registered:
    06 Dec 2016
    16 Jun 2015
    Link to this post
    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
     
  3. David
    David avatar
    114 posts
    Registered:
    19 Jul 2012
    18 Jun 2015 in reply to Stefani Tacheva
    Link to this post

    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?

  4. Sabrie Nedzhip
    Sabrie Nedzhip avatar
    534 posts
    Registered:
    08 Dec 2016
    23 Jun 2015
    Link to this post
    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
     
  5. David
    David avatar
    114 posts
    Registered:
    19 Jul 2012
    23 Jun 2015 in reply to Sabrie Nedzhip
    Link to this post

    Thanks Sabrie,

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

5 posts, 0 answered