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

Forums / Developing with Sitefinity / Customize LightBox image gallery problems

Customize LightBox image gallery problems

8 posts, 0 answered
  1. Michael
    Michael avatar
    31 posts
    Registered:
    07 Sep 2007
    12 Apr 2010
    Link to this post
    I am having a problem cutimizing my LightBox photo gallery.  I have made the changes my configuration xml file and uploaded my GalleryLightboxList.ascx file, but the changes I made to the GalleryLightboxList.ascx are not taking affect.  I have also done an IIS7 restart.  Is there anything else I need to change to make this to work.

    <?xml version="1.0" encoding="utf-8"?>
    <controlsConfig>
      <viewMap>
        <viewSettings hostType="Telerik.Libraries.WebControls.ImageGallery">
          <additionalTemplates>
            <add key="ItemListTemplatePath" layoutTemplatePath="~/Sitefinity/ControlTemplates/Libraries/GalleryListView.ascx" />
            <add key="SingleItemTemplatePath" layoutTemplatePath="~/Sitefinity/ControlTemplates/Libraries/GalleryListViewItem.ascx" />
          </additionalTemplates>
        </viewSettings>
      </viewMap>
    </controlsConfig>
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    12 Apr 2010
    Link to this post
    Hi Michael,

    Try mapping the templates from the control's ItemListTemplatePath property ( it is located under TemplatePaths section of the Advanced tab) or by using the ControlDesigner mapping - Working with presentation modes.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Michael
    Michael avatar
    31 posts
    Registered:
    07 Sep 2007
    13 Apr 2010
    Link to this post
    I have made changes to my configuration XML and ImageGalleryControlDesigner.ascx.  I am receiving this error when I try to edit any gallery.

    Server Error in '/' Application.

    Parser Error

    Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

    Parser Error Message: The resource object with key 'GalleryDesigner_WhichImagesToDisplay' was not found.

    Source Error:

    Line 10:             <!-- Wizard panel 1 -->
    Line 11:             <div id="Panel1">
    Line 12:                 <h3><asp:Literal ID="Literal11" runat="server" Text="<%$Resources:GalleryDesigner_WhichImagesToDisplay %>"></asp:Literal></h3>
    Line 13:                 <div>
    Line 14:                     <sf:GallerySelector 

    Source File: /Sitefinity/Admin/ControlTemplates/Libraries/ImageGalleryControlDesigner.ascx    Line: 12


    Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.4049

    <?xml version="1.0" encoding="utf-8"?>
    <controlsConfig>
      <viewMap>
        <!--Provides user interface for setting up the ImageGallery control designer in the Images & Documents module.-->
        <viewSettings hostType="Telerik.Libraries.WebControls.Design.ImageGalleryDesigner" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Libraries/ImageGalleryControlDesigner.ascx" />
        <viewSettings hostType="Telerik.Libraries.WebControls.ImageGallery">
          <additionalTemplates>
          <add key="ItemListTemplatePath" layoutTemplatePath="~/Sitefinity/ControlTemplates/Libraries/GalleryListView.ascx" />
          <add key="SingleItemTemplatePath" layoutTemplatePath="~/Sitefinity/ControlTemplates/Libraries/GalleryListViewItem.ascx" />
         </additionalTemplates>
        </viewSettings>
      </viewMap>
    </controlsConfig>
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    13 Apr 2010
    Link to this post
    Hello Michael,

    This is general ASP.NET error. You have not added the resx files of the template and it is looking for them in the local App_LocalResourced folder. Since the resources are not there, you get the error. The resx files are exposed in the same root folder (Libraries) from which you have got the template.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  5. Dave
    Dave avatar
    2 posts
    Registered:
    19 Nov 2010
    20 Nov 2010
    Link to this post
    Hi,

    I'm using a very similar code block as above in order to redirect the Telerik.Libraries.WebControls.ImageGallery control to use my customized template for 'ItemListTemplatePath'.

    When using the back end UI to manually set this property of the control, it uses my custom template with no problems.

    When using the following code block in \App_Data\Configuration instead of the back end UI way (very similar if not identical to the code block above), the template does not get applied.

    <viewSettings hostType="Telerik.Libraries.WebControls.ImageGallery">
      <additionalTemplates>
        <!--Lightbox Image Gallery-->
        <add key="ItemListTemplatePath" layoutTemplatePath="~/SitefinityControlTemplates/ControlTemplates/Libraries/GalleryLightboxListTemplate.ascx" />
      </additionalTemplates>
    </viewSettings>

    Is there any reason why setting the template in the XML configuration doesn't work?  From a maintainability standpoint I would rather configure this custom template to be used for every ImageGallery control used instead of requiring a manual back end UI step to manually set the template for every image gallery control I need.
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    21 Nov 2010
    Link to this post
    Hi Dave,

    You can map the designer - ImageGalleryControlDesigner.ascx and then the template as shown in this post - Working with presentation modes.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Dave
    Dave avatar
    2 posts
    Registered:
    19 Nov 2010
    22 Nov 2010
    Link to this post
    Thanks, but as I dug deeper I ended up trying 'ItemListTemplate' instead of 'ItemListTemplatePath' and now the ImageGallery uses my custom template in the way that I expected.

    I've added my excerpt from the XML configuration file below:

    <viewSettings hostType="Telerik.Libraries.WebControls.ImageGallery">
      <additionalTemplates>
        <!--Lightbox Image Gallery-->
        <add key="ItemListTemplate" layoutTemplatePath="~/SitefinityControlTemplates/ControlTemplates/Libraries/GalleryLightboxListTemplate.ascx" />
      </additionalTemplates>
    </viewSettings>
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    22 Nov 2010
    Link to this post
    Hello Dave,

    This was an issue in the older versions of Sitefinity. It should be fixed in build 2136 which is Sitefinity 3.7 SP4.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
8 posts, 0 answered