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

Forums / Developing with Sitefinity / Add Description to an image from Images & Documents module

Add Description to an image from Images & Documents module

10 posts, 0 answered
  1. FlR
    FlR avatar
    49 posts
    Registered:
    05 Oct 2010
    05 Oct 2010
    Link to this post
    I would like to activate the ability to add Description to an image in Images&Document module using Sitefinity Standard Edition 3 .7 SP4 

    This page 
    http://www.sitefinity.com/devnet/kb/sitefinity-3-x/how-to-add-description-to-images-in-the-images-documents-module.aspx
    explains how and everything works untio step 2; I don't find the file where I need to add the controls itself.

    Please provide some guidlines.

    Thank you!

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    06 Oct 2010
    Link to this post
    Hi Florin,

    You have to map external template - LibraryItemEdit.ascx. Please take a look at this KB

    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. FlR
    FlR avatar
    49 posts
    Registered:
    05 Oct 2010
    06 Oct 2010
    Link to this post
    Thank you! It worked. One remaining question.

    I added the description and selected the lightbox style to display the images.

    In the lightbox pop'up under title I would like to add the description. In general I was doing this by adding to the <a href=""...........title="Image name<br/>here is the description".

    In what ascx file can I found the lightbox declaration to append the description?

    Thank you!
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    06 Oct 2010
    Link to this post
    Hi FR,

    The external template that is used by Lightbox presentation mode is "GalleryLightboxList.ascx"
    Inside the template there is a HyperLink that is mapped to the [rel]Lightbox

    <asp:HyperLink ID="Title" runat="server" rel="lightbox[images]" />


    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
  5. FlR
    FlR avatar
    49 posts
    Registered:
    05 Oct 2010
    07 Oct 2010
    Link to this post
    Hi,

    Thank you for your answer.
    I've done the following steps
    1. Added
    Sitefinity_3_7_standard_ExternalTemplates/Sitefinity/Admin/ControlTemplates/Libraries/Modes/GalleryLightboxList.ascx
    to my website keeping the same structure
    2. I've seen that this cannot added in App_Data/Configuration/Telerik.Sitefinity.Configuration.ControlsConfig.xml (I didn't see it in the downloaded file); I've loked the ascx whihc is referencing it and found
    Sitefinity_3_7_standard_ExternalTemplates/Sitefinity/Admin/ControlTemplates/Libraries/ImageGalleryControlDesigner
    3. I've added the above ImageGalleryControlDesigner to my website and also in Telerik.Sitefinity.Configuration.ControlsConfig.xml
    4. I've went to GalleryLightboxList.ascx and made a modification but the modification doesn't appear on the front side.

    I think it has to do with Step 2 because I didn't find a reference in Telerik.Sitefinity.Configuration.ControlsConfig.xml for GalleryLightboxList.ascx

    Please tell me if I'm right and what should I do.

    Thank you!
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    07 Oct 2010
    Link to this post
    Hi Florin,

    Map the control designer through configuration file

    <viewSettings hostType="Telerik.Libraries.WebControls.Design.ImageGalleryDesigner" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Libraries/ImageGalleryControlDesigner.ascx" />

    Then map the Gallery template as described in this post Working with presentation modes

    Greetings,
    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. FlR
    FlR avatar
    49 posts
    Registered:
    05 Oct 2010
    07 Oct 2010
    Link to this post
    Hi,

    Thank you. It worked.

    The only remaining issue is exactly the purpose of having Description.
    Because in lightbox an workaround was to add to the link the attribute Title="Custom title <br/>Custom description" I would like to use the same idea here.

    This means to set the title attribute of <asp:HyperLink ID="Title" runat="server" rel="lightbox[images]" />
    I think you are doing this from code behind.

    How can I append the description to. In the end to have
    <a href="Libraries/Photos/Test_image.sflb.ashx" rel="lightbox[images]" title="Photo1 <br/> This is the description" id="ctl00_Content_ImageGallery2_ctl00_ctl00_repeater_ctl01_Title">Photo1</a>
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    07 Oct 2010
    Link to this post
    Hi FR,

    You need a custom control where you append the description to the title

    usingSystem;
    usingSystem.Collections.Generic;
    usingSystem.Linq;
    usingSystem.Web;
    usingTelerik.Libraries.WebControls;
    usingSystem.Web.UI.WebControls;
       
       
    /// <summary>
    /// Summary description for CustomImageLightbox
    /// </summary>
    public class CustomImageLightbox : ImageGallery
    {
        public CustomImageLightbox()
        {
            //
            // TODO: Add constructor logic here
                   //
        }
        
        public override string ItemListTemplatePath
        {
            get
            {
                // here you have to return your custom template
               // return "~/Sitefinity/Admin/ControlTemplates/MyLibraries/Modes/GallerySimpleList.ascx";
                return"~/Sitefinity/ControlTemplates/myLibraries/GalleryLightboxList.ascx";
            }
       
        }
       
        protected override void SetListMetadata(System.Web.UI.Control itemContainer, Telerik.Cms.Engine.IContent contentItem)
        {
            base.SetListMetadata(itemContainer, contentItem);
       
       
            switch(this.GalleryTemplateMode)
            {
                caseGalleryViewMode.Lightbox:
                    if (this.galleryViewMode == GalleryViewMode.ListDetails)
                            {
                                downloadLink.NavigateUrl = GetItemUrl(contentItem, this.SingleItemUrl);
     
                                HyperLink titleLink = itemContainer.FindControl("Title") as HyperLink;
                                if (titleLink != null)
                                {
                                    titleLink.NavigateUrl = downloadLink.NavigateUrl;
                                    titleLink.Text = contentItem.GetMetaData("Name").ToString() + "<br />" +contentItem.GetMetaData("Description").ToString() ;
                                  
                                }
                            }
                 break;
                caseGalleryViewMode.BigImageAndList:
                    break;
                caseGalleryViewMode.ListDetails:
                    break;
       
            }
        }
    }

    control registration

    <toolboxControls>
        <clear/>
           
    <add name="LibraryControl" section="Images" type="CustomImageLightbox , App_Code"/>


    Greetings,
    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
  9. FlR
    FlR avatar
    49 posts
    Registered:
    05 Oct 2010
    12 Oct 2010
    Link to this post
    Hi Ivan.

    I've done the above flow with the difference thatItemListTemplatePath returns "~/Sitefinity/Admin/ControlTemplates/Libraries/Modes/GalleryLightboxList.ascx" which is the presentation mode gine as path also to the control designer MasterTemplateName and DetailTemplateName

    Now when I'm editing the Page and check for the control I see the message "Error Loading Control"
  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    12 Oct 2010
    Link to this post
    Hi FR,

    You could get Error loading control if the type of the control does not match the registration in the web.config
    <toolboxControls> section.

    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
Register for webinar
10 posts, 0 answered