Modifying thumbnail display

Posted by Community Admin on 03-Aug-2018 13:37

Modifying thumbnail display

All Replies

Posted by Community Admin on 08-Mar-2011 00:00

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?

Posted by Community Admin on 10-Mar-2011 00:00

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.

Posted by Community Admin on 02-May-2011 00:00

Where do I put this file to extend the Image Gallery control?

Posted by Community Admin on 02-May-2011 00:00

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

Posted by Community Admin on 02-May-2011 00:00

Are there any tutorial links I could follow to do this?

Posted by Community Admin on 05-May-2013 00:00

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.

Posted by Community Admin on 09-May-2013 00:00

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

This thread is closed