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

Forums / Developing with Sitefinity / Issues Creating Lightbox-Style Image Gallery

Issues Creating Lightbox-Style Image Gallery

3 posts, 0 answered
  1. Tim
    Tim avatar
    7 posts
    Registered:
    13 Aug 2009
    03 Oct 2009
    Link to this post
    I am attempting to create an image gallery control on a page in a Lightbox style format. It does not seem to be setting the presentation mode.

    Here is the code...I am new to Sitefinity so I am sure I am just missing something basic...

       IStagedPage staged = page.Staged.CheckOut();     
            IPageTemplate pageTemplate = manager.GetTemplate("Default");     
            staged.SetTemplate(pageTemplate.ID, "Levels");     
        
            ImageGallery iGallery = new ImageGallery();     
            iGallery.ID = "ImageGallery2";     
            iGallery.GalleryTemplateMode = ImageGallery.GalleryViewMode.Lightbox;     
        
            page = (ICmsPage)manager.GetPage(page.ID, true);     
            page.Staged.AddControl("Content", iGallery);     
        
            page = (ICmsPage)manager.GetPage(page.ID, true);     
            page.Staged.CheckIn();     
            page.Publish();    
     
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    06 Oct 2009
    Link to this post
    Hi Tim,

    Please try adding the control as shown below:

                ImageGallery gal = new ImageGallery(); 
            gal.SelectedPresentationMode.ID = "Lightbox"
            gal.GalleryTemplateMode = ImageGallery.GalleryViewMode.Lightbox; 
            gal.BehaviorMode = Telerik.Cms.Engine.WebControls.ContentView.BehaviorModes.Master; 
            gal.ItemListTemplateName = "Telerik.Libraries.Resources.ControlTemplates.Frontend.GalleryLightboxList.ascx"
            Controls.Add(gal); 

    I hope this helps.

    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. Tim
    Tim avatar
    7 posts
    Registered:
    13 Aug 2009
    06 Oct 2009
    Link to this post
    Yes it did I could not find this documented anywhere.

    Thanks Ivan.
Register for webinar
3 posts, 0 answered