Modifying thumbnail display
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?
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.
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) ;
Where do I put this file to extend the Image Gallery control?
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
Are there any tutorial links I could follow to do this?
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.
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