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

Forums / Developing with Sitefinity / Extending ImageGallery Presentation Mode

Extending ImageGallery Presentation Mode

4 posts, 0 answered
  1. Nigel
    Nigel avatar
    49 posts
    Registered:
    07 Jul 2008
    02 Sep 2009
    Link to this post
    Hi, I would like to add a description to the lightbox presentation mode. I have added the MetaData, and got the edit screen to take this new data and store it for the images in the library, but now I am at the frontend part and I can not see where I would override/extend the ImageGallery to use my new field and pass it to the Lightbox.

    The crux of my question is: How do you override/extend presentation modes?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    02 Sep 2009
    Link to this post
    Hello Nigel,

    1. You should map the external template GalleryLightboxList.ascx.
    2. Then if you want to control the metakey you added through the control designer - for instance whether to show it on this instance of the control or not you need to map the ControlDesigner - ImageGalleryControlDesigher and modify it. In the desired presentation mode you can add your metakey as TextSettings control.

    3. Finally to show your data in the LightBox mode you need to override ImageGalley control and set your metakey. Below is a sample code:

    using System; 
    using System.Collections.Generic; 
    using System.Linq; 
    using System.Web; 
    using Telerik.Libraries.WebControls; 
    using System.Web.UI.WebControls; 
     
    /// <summary> 
    /// Summary description for CustomImageGalleryControl 
    /// </summary> 
    public class CustomImageGalleryControl : ImageGallery 
        public CustomImageGalleryControl() 
        { 
        } 
     
        public override string ItemListTemplatePath 
        { 
            get 
            { 
                return "~/Sitefinity/Admin/ControlTemplates/Libraries/Modes/GalleryLightboxList.ascx"
            } 
        } 
     
         protected override void SetListMetadata(System.Web.UI.Control itemContainer, Telerik.Cms.Engine.IContent contentItem) 
         { 
             base.SetListMetadata(itemContainer, contentItem); 
     
             HyperLink downloadLink = itemContainer.FindControl("DownloadLink"as HyperLink; 
             downloadLink.ToolTip = String.Concat(contentItem.GetMetaData("Name"), contentItem.GetMetaData("MyCustomDescription"); 
         } 
     


    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Nigel
    Nigel avatar
    49 posts
    Registered:
    07 Jul 2008
    04 Sep 2009
    Link to this post
    Thanks for that, I assume since I am doing all my controls as part of a control library I will need to embed the templates from the ImageGallery and override all the modes as well?

    I am getting the following error, which makes sense
    Invalid resource name (Telerik.Libraries.Resources.ControlTemplates.Frontend.GalleryListView.ascx) for assembly (IC_Solutions.SiteFinity.ToolBoxControls, Version=1.0.0.0, Culture=neutralPublicKeyToken=null) or empty template.   
     
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    04 Sep 2009
    Link to this post
    Hi Nigel,

    As I see it you are trying to create a new PublicView control (C_Solutions.SiteFinity.ToolBoxControls) if so you should embed the templates and create a designer for your public control ( or use the default one)

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
4 posts, 0 answered