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

Forums / General Discussions / Modifying thumbnail display

Modifying thumbnail display

7 posts, 0 answered
  1. Josh Anderson
    Josh Anderson avatar
    48 posts
    Registered:
    15 Dec 2005
    08 Mar 2011
    Link to this post
    I have an image gallery on my page with the full-size lightbox view, but I'd like to be able to specify or modify the thumbnail image instead of using the default resized full image. I see that images in 4.0 have a thumbnail property section, but it shows as not yet implemented. Does anyone know when this might be implemented, or whether there's an easy workaround?

    I was hoping to avoid having to wire up a lightbox/fancybox preview on my own, but if I did have to do that how can I get Sitefinity to add the required javascript to the page?
  2. Milena
    Milena avatar
    75 posts
    Registered:
    15 Jul 2016
    10 Mar 2011
    Link to this post
    Hello Josh,

    For the feature you are requesting I logged a new product backlog item with id 110220, which need  to be planned for development.


    It is possible to implement workaround by executing following steps:

    1) You should extend the  MasterThumbnailLightBoxView of the ImagesView. You can override ConfigureDetailLink method and inside  set  different image size for image items.

    Sample :
    namespace Telerik.Sample
    {
        public class MasterThumbnailLightBoxViewCustom : MasterThumbnailLightBoxView
        {
            protected override void ConfigureDetailLink(System.Web.UI.WebControls.HyperLink singleItemLink, Image dataItem, RadListViewItem item)
            {
                singleItemLink.ImageUrl = String.Concat(dataItem.MediaUrl, "?size=250");
                singleItemLink.Text = dataItem.AlternativeText;
                singleItemLink.ToolTip = dataItem.Description;
                singleItemLink.NavigateUrl = dataItem.MediaUrl;
     
            }
     
            public override System.Collections.Generic.IEnumerable<ScriptDescriptor> GetScriptDescriptors()
            {
                return new[] { new ScriptControlDescriptor(typeof(MasterThumbnailLightBoxView).FullName, this.ClientID) };
            }
     
        }
    }

    2) You need to configure ViewType at Library configuration for image view. See details at attached file.

    3) You need to apply corresponding changes for height and with for image at css classes at your custom theme.
  3. James
    James avatar
    33 posts
    Registered:
    03 Apr 2011
    02 May 2011
    Link to this post
    Where do I put this file to extend the Image Gallery control?
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    02 May 2011
    Link to this post
    Hello James,

    You could create a class library that inherits from MasterThumbnailLightBoxView and follow the suggestions from the previous post.

    All the best,
    Ivan Dimitrov
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  5. James
    James avatar
    33 posts
    Registered:
    03 Apr 2011
    02 May 2011
    Link to this post
    Are there any tutorial links I could follow to do this?
  6. denny
    denny avatar
    13 posts
    Registered:
    16 Oct 2007
    05 May 2013
    Link to this post
    So I've been trying to implement this all night long.  With no luck.

    I am actually doing both gallery views, with lightbox and with details page.  What's really weird is I KNOW I'm doing it right because when I do it with the regular MasterThumbnailView it works fine.

    However when I build a second class, literally a copy and paste of the other one only renaming the file, class and changing inheritance to MasterThumbnailLightBoxView it blows up in my face.  When I set it under Library configuration it saves OK, but when I open the page editor the "More" links on all of the controls don't work and in f12 console I see jQuery has crashed with error "SCRIPT5009: 'SitefinityWebApp' is undefined " (which is the namespace, and is the exact same as the namespace in the MasterThumbnailView version).

    Any clues?  Would be nice to sort this out quick, light boxes are the spec for this client.

    Attached are screen caps of the two files.
  7. Stefani Tacheva
    Stefani Tacheva avatar
    718 posts
    Registered:
    06 Dec 2016
    09 May 2013
    Link to this post
    Hello,

    Could you please inform us how did you register the controls CustomGallaryWithLightBox and CustomCallary in Sitefinity? Please send us screenshots of the ViewTypes that you have set in the configuration sections of the Sitefinity backend to verify that the types you have entered are correct.

    Kind regards,
    Stefani Tacheva
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
7 posts, 0 answered