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

Forums / Developing with Sitefinity / User control not visible inside project

User control not visible inside project

13 posts, 0 answered
  1. Viren
    Viren avatar
    41 posts
    Registered:
    03 Aug 2010
    15 Oct 2010
    Link to this post
    I am using an image gallery control on one of my sitefinity templates. where is it located within my website folder? I checked inside Websiteroot > Sitefinity >UserControls but could not find any file relating to an image control.? It appears to be inside the config file in the toolboxcontrols sections however there is no url attribute insdie the tag corresponding to the image control.? How can i edit some of the properties of the control like the css class to use for the single page when the user clicks on a thumbnail in case of a "List and Page" display mode? i want to use my own styling for  the single Page that opens up when a thumbnail is clicked in my image gallery.

    Thanks
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    18 Oct 2010
    Link to this post
    Hi Viren,

    ImageGallery is a custom control and it uses embedded templates and css styles. You could set all public properties of the control through the ControlDesigner that opens when you open the control for editing.

    You could map external templates and modify GalleryListViewItem.ascx where you can inject your css.

    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
  3. Viren
    Viren avatar
    41 posts
    Registered:
    03 Aug 2010
    21 Oct 2010
    Link to this post
    Thanks. I did follow the link the map external template. Here are the contents of my Telerik.Sitefinity.Configuration.ControlsConfig.xml file under App_Data > Configuration :

    <?xml version="1.0" encoding="utf-8" ?>
    <controlsConfig>
        <viewMap>
            <!-- Insert a new news item template -->
            <!--viewSettings hostType="Telerik.Libraries.WebControls.ImageGallery.Admin.ImageGalleryExtended"
                          layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/ImageGallery/ImageGalleryExtended.ascx">
            </viewSettings>-->
            <viewSettings hostType="Telerik.Libraries.WebControls.Design.ImageGalleryDesigner"
                          layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Libraries/ImageGalleryControlDesigner.ascx" >
            </viewSettings>
            <viewSettings hostType="Telerik.Libraries.WebControls.Design.GalleryDesigner"
                          layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Libraries/GalleryControlDesigner.ascx" >
            </viewSettings>
            <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>

    According to what I understand, now this config file should be given preference and it should the GalleryListView and GalleryListItemView templates that I copied inside the ~/Sitefinity/ControlTemplates/Libraries folders. However it still does not  reflect any changes that I make to these files in the image gallery control on my template.

    I also modified the css link as follows:
    <telerik:CssFileLink ID="CssFileLink1" FileName="http://localhost/projectName/Sitefinity/ControlTemplates/Libraries/GalleryViewList.css"  Media="Screen" runat="server" />

    Please NOTE: I removed the EmbeddedFile attribute to make sure that it does not USE any embedded css here.

    And made a few changes to classes like the sf_image, sf_BigImage and sf_pager to see if they are reflected in the control on my template but without success.

    Just to make sure that everything is consistent I also edited the folowing inside the ImageGalleryControlDesigner file under Sitefinity>Admin>ControlTemplates>Libraries :

    <sf:PresentationMode ID="ListDetails"
                                                 runat="server"
                                                 ModeTitle="List &amp; page"
                                                 ModeSettingsId="ModeSettings1"
                                                 MasterTemplateName="GalleryListView.ascx"
                                                 DetailTemplateName="GalleryListViewItem.ascx"
                                                 SelectedCssClass="selectedOption">

    I also did the corresponding similar changes for GalleryViewListItem template.

    When I went inside the control settings and changed the MasterTemplateName = GalleryListView.ascx and MasterTemplatePath = "~/Sitefinity/ControlTemplates/Libraries/GalleryListView.ascx", it gives me the following error:

    Invalid resource name (GalleryListView.ascx) for assembly (Telerik.Libraries, Version=3.7.2096.2, Culture=neutral, PublicKeyToken=dfeaee0e3978ac79) or empty template.

    Why is it still not taking the external template? Where am I wrong?

    Can you please help me with these specifics to make the image gallery control use these external templates instead of the embedded ones so that I could customize the looks and also insert a javascript inside the control.

    Thanks.




  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    21 Oct 2010
    Link to this post
    Hi Viren,

    When you use the control designer the properties should be

    MasterTemplatePath="GalleryListView.ascx"
    DetailTemplatePath="GalleryListViewItem.ascx"

    Regards,
    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. Viren
    Viren avatar
    41 posts
    Registered:
    03 Aug 2010
    21 Oct 2010
    Link to this post
    By the way, I DO have all the local resource files in place under the App_Resource folder. I have copied the following templates for .NET 2.0 (downloaded from Telerik's website)

    GalleryListView.ascx,
    GalleryListViewItem.ascx,
    ImageGalleryControlDesigner.ascx,
    GalleryControlDesigner.ascx,
    ImageGalleryControlDesigner.ascx.resx,
    GalleryControlDesigner.ascx.resx,
    GalleryListView.ascx.resx and
    GalleryListViewItem.ascx.resx

    and extracted them to the correct paths inside the projectName>Sitefinity folder.
  6. Viren
    Viren avatar
    41 posts
    Registered:
    03 Aug 2010
    21 Oct 2010
    Link to this post
    So basically these are the public property values that I should be using in the image gallery control on my template?

    Is the error occuring because of the following inside GalleryControlDesigner.ascx file?

    <%@ Register Assembly="Telerik.Libraries" Namespace="Telerik.Libraries.WebControls" TagPrefix="sfWeb" %>

    Also there are references to the assembly inside ImageGalleryControlDesigner.ascx file:
    <%@ Register Assembly="Telerik.Libraries" Namespace="Telerik.Libraries.WebControls" TagPrefix="sf" %>
    <%@ Register Assembly="Telerik.Cms.Engine" Namespace="Telerik.Cms.Engine.WebControls.Design" TagPrefix="sf" %>
    <%@ Register Assembly="Telerik.Cms.Engine" Namespace="Telerik.Cms.Engine.WebControls.Design.Settings" TagPrefix="sf" %>
    <%@ Register Assembly="Telerik.Cms.Engine" Namespace="Telerik.Cms.Engine.WebControls.Design.Selectors" TagPrefix="sf" %>

  7. Viren
    Viren avatar
    41 posts
    Registered:
    03 Aug 2010
    21 Oct 2010
    Link to this post
    Thanks Ivan. I now have control over the css for the template.
  8. Viren
    Viren avatar
    41 posts
    Registered:
    03 Aug 2010
    21 Oct 2010
    Link to this post
    However I am not able to get the "Image&List" presentation mode right.

    I have uploaded the GalleryBigImageAndList.ascx file and its corresponding resource file in my project. Can you please tell me which of the following properties has been set incorrectly inside the control:

    1. Advanced>Appearance>SelectedPresentationMode(edit)>MasterTemplateName = Telerik.Libraries.Resources.ControlTemplates.Frontend.GalleryBigImageAndList.ascx

    2. MasterTemplatePath = GalleryBigImageAndList.ascx

    3. Advanced>Misc>ItemListTemplateName =  GalleryListView.ascx

    4. Advanced>Misc>AssemblyInfo = Telerik.Libraries.WebControls.ImageGallery

    5. Advanced>Misc>SingleItemTemplateName = GalleryListViewItem.ascx

    6. Advanced>Misc>LocalizationAssemblyInfo = Telerik.Libraries.WebControls.ImageGallery

    7. Advanced>Template Paths>ItemListTemplatePath (?) = GalleryListView.ascx

    8. Advanced>Template Paths>SingleItemTemplatePath (?) = GalleryListViewItem.ascx

    Relevant content inside ImageGalleryControlDesigner.ascx:
                                               <sf:PresentationMode ID="BigImageAndList"
                                                 runat="server"
                                                 ModeTitle="Image &amp; List"
                                                 ModeSettingsId="ModeSettings5"
                                                 MasterTemplateName="GalleryBigImageAndList.ascx"
                                                 SelectedCssClass="selectedOption">
    Relevant content inside GalleryBigImageAndList.ascx:
    <telerik:JsFileLink id="jsLink" runat="server" ScriptType="jQuery" />
    <telerik:CssFileLink ID="CssFileLink1" FileName="" Media="screen" runat="server" EmbeddedFileName="Telerik.Libraries.Resources.ControlTemplates.Frontend.librariesCommonLayout.css"  />





  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    21 Oct 2010
    Link to this post
    Hello Viren,

    You should use MasterTemplatePath for the designer settings, not MasterTempateName.


    Kind regards,
    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
  10. Viren
    Viren avatar
    41 posts
    Registered:
    03 Aug 2010
    21 Oct 2010
    Link to this post
    Thank you Ivan. I am assuming that all the remaining properties have been set correctly to display in the Image&List mode. I will check it quickly and update here.

    Thanks.
  11. Viren
    Viren avatar
    41 posts
    Registered:
    03 Aug 2010
    21 Oct 2010
    Link to this post
    It still does not display the Image&List mode correctly. In the control I selected 3 items per page and Image and List display option. All I see in the preview are 3 thumbnails arranged vertically and not horizontally. As mentioned I assumed that you meant all other settings are correct so I did not change them.

    Any idea as to why this behavior? I suspect its a styling issue but I am using the embedded style (EmbeddedFileName) as mentioned in my post above.

    Thanks.
  12. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    21 Oct 2010
    Link to this post
    Hi Viren,

    You could take a look at this post.

    Best wishes,
    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
  13. Viren
    Viren avatar
    41 posts
    Registered:
    03 Aug 2010
    21 Oct 2010
    Link to this post
    Thanks Ivan. I already have the generic stylesheet used for imagegallerycontrol and I am using the same for List&Page mode for an image gallery control on one of my templates. I have also repointed the "FileName=/my path../"
    to the file where I have copied the generic public styles and am editing those.

    This other control however uses GalleryBigImageAndList mode. I tried the following 2 statements at the top:

    FileName="http://localhost/projectName/Sitefinity/ControlTemplates/Libraries/myGalleryViewList.css"/>
    and also
    EmbeddedFileName="Telerik.Libraries.Resources.ControlTemplates.Frontend.librariesCommonLayout.css"  />

    In either case it displays 3 thumbnails vertically and when I click on 1 it opens the big image as a new page and not within the control itself. Also I hope that saw my note that I have kept the other settings still the same.

    Thanks
Register for webinar
13 posts, 0 answered