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

Forums / Developing with Sitefinity / Adding Thumbnails to blog

Adding Thumbnails to blog

43 posts, 0 answered
  1. Scott Williams
    Scott Williams avatar
    14 posts
    Registered:
    13 Oct 2009
    11 Nov 2009
    Link to this post
    Hi I know that you can display thumbnails along side news but is there anyway that I can do this with the Blog control? There are a number of features I want to use within blog but I also need to include thumbnails. Thanks
     
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    11 Nov 2009
    Link to this post
    Hi Scott Williams,

    It is possible. Below are the steps that you should follow:

    1. Map external templates for content item edit  and content item new - PostEdit.ascx and PostNew.ascx.
    2. Create a new metakey for Blogs provider called Thumbnail
    3. Add thumbnail selector inside ContentMetaFields control.

    <li class="selector">
        <asp:Label ID="Label2" AssociatedControlID="Thumbnail" runat="server"><asp:Literal ID="Literal14" runat="server" Text="<%$Resources:Thumbnail %>"></asp:Literal> <em id="ThumbnailLabel" runat="server"></em></asp:Label>
        <asp:TextBox ID="Thumbnail" Text="" runat="server" MaxLength="250"></asp:TextBox>
        <sfLib:ButtonSelector WindowNavigateUrl="~/Sitefinity/UserControls/Dialogs/ImageEditorDialog.aspx" ItemTemplatePath="~/Sitefinity/Admin/ControlTemplates/News/Dialogs/ButtonSelector.ascx" AssociatedControls="Thumbnail" runat="server" cssclass="pickerWrapper" ButtonText="<%$Resources:Select%>" />
        <p class="example">
       <asp:Literal ID="Literal15" runat="server" Text="<%$Resources:ThumbnailNote %>"></asp:Literal>
       </p>
    </li>

    4. Create a custom control that derives from BlogPosts.
    5. Override ItemListTemplatePath and SingleItemTemplatePath properties and set you templates.
    6. Override SetItemMetaData method , get the thumbnail metadata for the contentItem parameter - if there is an image resolve the value of the field and show the image.
    7. Make sure that you have registered a control ( for instance Image) in your public templates - ListPageMaster and ListPageDetail that will show the thumbnail

    Sample code:

    public class CustomBlogPosts : BlogPosts
    {
     
     
        public override string ItemListTemplatePath
        {
            get
            {
                return "~/Sitefinity/Admin/ControlTemplates/Blogs/Modes/ListPageMaster.ascx";
            }
        }
     
        public override string SingleItemTemplatePath
        {
            get
            {
                return "~/Sitefinity/Admin/ControlTemplates/Blogs/Modes/ListPageDetail.ascx";
            }
        }
     
        protected override void SetItemMetadata(System.Web.UI.Control itemContainer, Telerik.Cms.Engine.IContent contentItem)
        {
            base.SetItemMetadata(itemContainer, contentItem);
     
            Image img = (Image)itemContainer.FindControl("Image1");
            string thumb= (string)contentItem.GetMetaData("Thumbnail");
            
              ....
                  ....
              // TODO - SET IMAGE, RESOLVE URL
        }
     
     
     
    }


    Greetings,
    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. Joel Housman
    Joel Housman avatar
    12 posts
    Registered:
    28 Jul 2009
    18 May 2010
    Link to this post
    Ivan,

    Could you elaborate a little more on this process? I do not fully understand your instructions.

    1. How does one go about mapping external templates for 'content item edit' and 'content item new'. I've read documentation on mapping external templates from the help files and other forum posts, but it is not clear.

    2. How do you create a new metakey for Blogs provider? Where do you do this at? Which file? Where is that file located. It is very helpful to customers to tell us all of these things rather than assuming we already know these things.

    3. Where is ContentMetaFields control?

    4. Create a custom control that derives from derives from BlogPosts? Where? How?

    I'll just stop here. But suffice it to say, I too need to add thumbnails to blogs. I found this documentation here: http://www.sitefinity.com/sf3/faq.html#87 Which makes perfect sense to me and I started doing until i realized that it was for Sitefinity 3.2. When I tried to figure it out how to do it for Sitefinity 3.7 I found that you had made this process 100x more complicated and your documentation, unlike for 3.2, doesn't speak to adding custom fields to blogs. It gives an example for the news modile about a field in which I know nothing about. It is very confusing.
  4. Jay Mehta
    Jay Mehta avatar
    19 posts
    Registered:
    02 Sep 2009
    18 May 2010
    Link to this post
    Hi Ivan,

    I am planning to achieve the same thing, thumbnail functionality in Blogs module, but the steps are not clear to me either, tried mapping the external template, but could not find some of the files mentioned (for eg. ContentMetaFields control).


    Thank you,
    Jay Mehta.
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    18 May 2010
    Link to this post
    Hi Jay Mehta,

    • Mapping templates - How to map a template
    • Adding metafields -  UserManual, section - Adding Custom Fields
    • ContentMetaFields controls is inside the template. This control persists and retrieves the data for the metakeys dynamically, so you should not do this manually.
    • Here is a forum post that shows how to create a custom control that inherits from BlogPosts - blog-posts-control

    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.
  6. Jay Mehta
    Jay Mehta avatar
    19 posts
    Registered:
    02 Sep 2009
    18 May 2010
    Link to this post
    Hi Ivan,

    Thank you for the quick reply, that helps. Can you please help or elaborate more on Steps 6 and 7.

    Thank you,
    Jay Mehta.
  7. Jay Mehta
    Jay Mehta avatar
    19 posts
    Registered:
    02 Sep 2009
    19 May 2010
    Link to this post
    HI Ivan,

    I followed till step 3 and when I try to visit the Blog Edit page I receive the following error.
    Also, could you please help on further steps.

    Thank you,
    Jay Mehta.
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    19 May 2010
    Link to this post
    Hi Jay Mehta,

    The error is thrown, because the resource key you use is not presented in the resx file for this template. Please add the resource key or resx file in case it is missing from App_LocalResources folder.

    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.
  9. Jay Mehta
    Jay Mehta avatar
    19 posts
    Registered:
    02 Sep 2009
    19 May 2010
    Link to this post
    Thanks Ivan, I was able to resolve that issue, forgot to update the blog.

    I am able to upload thumbnail for a blog post, but how can I display it on the client end?
    What modifications I need to make or further steps I need to take. 

    Thank you,
    Jay Mehta.
  10. Jay Mehta
    Jay Mehta avatar
    19 posts
    Registered:
    02 Sep 2009
    21 May 2010
    Link to this post
    Hi Ivan,

    I was able to cover all the steps you mentioned, but still it did not display the thumbnail. Can you guide on what could be wrong.

    Here are the steps I did and the code snippet:
    1: Mapped the external templates
    2: Created Metakey for "Blogs.Thumbnail"
    3: Added the thumbnail selector code
    4: Created a class file with following code in the App_code folder
    using System;
    using System.Data;
    using System.Collections.Generic;
    using System.Linq;
    using System.Configuration;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Collections;
    using System.ComponentModel;
    using Telerik.Cms.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using Telerik.Blogs.WebControls;
    using Telerik.Cms.Engine;
    using Telerik.Framework.Web.Design;
    using Telerik.Lists.PersistentObjects;
      
    namespace Telerik.Blogs.WebControls
    {
        public class CustomBlogPosts : BlogPosts
        {
             
    public override string SingleItemTemplatePath
    {
     get
     {
        object obj = this.ViewState["SingleItemTemplatePath"];
        if (obj != null)
            return (string)obj;
        // otherwise return default path of the SingleItem Template. This should
        // be the path of the new template we have created
        return "~/Sitefinity/Admin/ControlTemplates/Blogs/Modes/ListPageDetail.ascx";
             }
     set
     {
        this.ViewState["SingleItemTemplatePath"] = value;
     }
        }
      
     
        public override string ItemListTemplatePath
    {
     get
     {
        object obj = this.ViewState["ItemListTemplatePath"];
        if (obj != null)
           return (string)obj;
        // otherwise return default path of the ItemList Template. This should 
        // be the path of the new template we have created
                return "~/Sitefinity/Admin/ControlTemplates/Blogs/Modes/ListPageMaster.ascx";
             }
     set
     {
        this.ViewState["ItemListTemplatePath"] = value;
     }
        }
     
     
    protected override void SetItemMetadata(System.Web.UI.Control itemContainer, Telerik.Cms.Engine.IContent contentItem)
        {
            base.SetItemMetadata(itemContainer, contentItem);
      
            Image img = (Image)itemContainer.FindControl("Image1");
            string thumb= (string)contentItem.GetMetaData("Thumbnail");
     
                if (img != null)
                {
                     
            img.ImageUrl = thumb;
            img.AlternateText = "This is from the class file";
                }
         
            }
        }
    }

    5: Registered this class in the web.config
    6: Added the Image control in the ListPageMaster and ListPageDetails
    <p class="sf_newsThumbnail"><asp:Image ID="Image1" runat="server" /></p>

    Thank you,
    Jay Mehta.
  11. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    24 May 2010
    Link to this post
    Hi Jay Mehta,

    If you use ButtonSelector control, it returns a Guid, so you need to resolve the dynamic url. You should also check whether thumb is String.Empty before setting any value to img.ImageUrl.

    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.
  12. Jay Mehta
    Jay Mehta avatar
    19 posts
    Registered:
    02 Sep 2009
    25 May 2010
    Link to this post
    Thanks Ivan,

    I added the logic for the url resolve, but still it is not displaying anything.
    Here is the code in the class file

    using System;
    using System.Data;
    using System.Collections.Generic;
    using System.Linq;
    using System.Configuration;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Collections;
    using System.ComponentModel;
    using Telerik.Cms.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using Telerik.Blogs.WebControls;
    using Telerik.Cms.Engine;
    using Telerik.Framework.Web.Design;
    using Telerik.Lists.PersistentObjects;
      
    namespace Telerik.Blogs.WebControls
    {
        public class CustomBlogPosts : BlogPosts
        {
             
    public override string SingleItemTemplatePath
    {
     get
     {
        object obj = this.ViewState["SingleItemTemplatePath"];
        if (obj != null)
            return (string)obj;
        // otherwise return default path of the SingleItem Template. This should
        // be the path of the new template we have created
        return "~/Sitefinity/Admin/ControlTemplates/Blogs/Modes/ListPageDetail.ascx";
             }
     set
     {
        this.ViewState["SingleItemTemplatePath"] = value;
     }
        }
      
     
        public override string ItemListTemplatePath
    {
     get
     {
        object obj = this.ViewState["ItemListTemplatePath"];
        if (obj != null)
           return (string)obj;
        // otherwise return default path of the ItemList Template. This should 
        // be the path of the new template we have created
                return "~/Sitefinity/Admin/ControlTemplates/Blogs/Modes/ListPageMaster.ascx";
             }
     set
     {
        this.ViewState["ItemListTemplatePath"] = value;
     }
        }
     
     
    private string GetItemUrl(string val)
        {
            if (val.StartsWith("~/"))
                return this.ResolveUrl(val);
      
            if (val.StartsWith("["))
            {
                int idx = val.IndexOf("]");
                string provider = val.Substring(1, idx - 1);
                string strId = val.Substring(idx + 1);
                Guid id = new Guid(strId);
      
                if (ContentManager.Providers.ContainsKey(provider))
                {
                    IContent cnt = ContentManager.Providers[provider].GetContent(id);
                    if (cnt != null)
                        return VirtualPathUtility.ToAbsolute(cnt.UrlWithExtension, this.Context.Request.ApplicationPath);
                }
            }
            return val.ToString();
        }  
     
     
    protected override void SetItemMetadata(System.Web.UI.Control itemContainer, Telerik.Cms.Engine.IContent contentItem)
        {
            base.SetItemMetadata(itemContainer, contentItem);
      
            Image img = (Image)itemContainer.FindControl("Image1");
             
                if (img != null)
                {
                     
            string thumb= GetItemUrl((string)contentItem.GetMetaData("Thumbnail"));
     
            img.ImageUrl = thumb;
            img.AlternateText = "This is from the class file";
                }
         
            }
        }
    }

    I also tried commenting the Image url and just displaying AlternateText, but did not display that. I feel it is not reaching this part of the code.

    Thank you,
    Jay Mehta.
  13. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    26 May 2010
    Link to this post
    Hello Jay Mehta,

    If the image is null in your code then neither thumb not AlternateText will be set. Make sure that the path the your image has been resolved.

    The code below works fine at my end


    protected override void SetItemMetadata(Control itemContainer, IContent contentItem)
       {
                base.SetItemMetadata(itemContainer, contentItem);
                   string key = "Thumbnail";
                   Control ctrl = base.FindContentViewControl(key , itemContainer);
                   string imageUrl = (string)contentItem.GetMetaData(key);
                   if (!String.IsNullOrEmpty(imageUrl))
                   {
                       ((System.Web.UI.WebControls.Image)ctrl).ImageUrl = this.GetItemUrl(imageUrl, false);
                   }
      
       }


    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.
  14. Jay Mehta
    Jay Mehta avatar
    19 posts
    Registered:
    02 Sep 2009
    26 May 2010
    Link to this post
    Thanks Ivan,

    I tried your code and also tried just accessing the Title literal from the ListPageDetail.ascx file and changing the text for it, but not sure why it is not making any changing on the front side.

    Here is the change I made in the code that you sent

    protected override void SetItemMetadata(Control itemContainer, IContent contentItem)
       {
                base.SetItemMetadata(itemContainer, contentItem);
                   string key = "Thumbnail";
                   Control ctrl = base.FindContentViewControl(key , itemContainer);
    Literal ctrl1 = itemContainer.FindControl("Title") as Literal;
    ctrl1.Text = "Hi";
                   string imageUrl = (string)contentItem.GetMetaData(key);
                   if (!String.IsNullOrEmpty(imageUrl))
                   {
                       ((System.Web.UI.WebControls.Image)ctrl).ImageUrl = this.GetItemUrl(imageUrl, false);
                   }
       
       }

    Can you please let me know, what I am missing.
    Is there a way, I can find if the control is reaching in this method?

    Thank you,
    Jay Mehta.
  15. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    27 May 2010
    Link to this post
    Hello Jay Mehta,

    Please use the code below.


    public class BlogPostsCustomControl : BlogPosts
    {
        public BlogPostsCustomControl()
        {
        }
        public override string SingleItemTemplatePath
        {
            get
            {
                return "~/Sitefinity/Admin/ControlTemplates/Blogs/Modes/ListPageDetail.ascx";
                
            }
     
        }
     
        public override string ItemListTemplatePath
        {
            get
            {
                return "~/Sitefinity/Admin/ControlTemplates/Blogs/Modes/ListPageMaster.ascx";
            }
        }
     
     
        protected override void SetItemMetadata(Control itemContainer, IContent contentItem)
        {
            base.SetItemMetadata(itemContainer, contentItem);
            foreach (IMetaInfo info in Manager.MetaKeys.Values)
            {
                Control ctrl = base.FindContentViewControl(info.Key, itemContainer);
                if ((ctrl != null)
                     && (ctrl is System.Web.UI.WebControls.Image)
                     && (info.ValueType == MetaValueTypes.ShortText))
                {
                    string imageUrl = (string)contentItem.GetMetaData(info.Key);
                    if (!String.IsNullOrEmpty(imageUrl))
                    {
                        ((System.Web.UI.WebControls.Image)ctrl).ImageUrl = this.GetItemUrl(imageUrl, false);
                    }
                    else
                    {
                        ((System.Web.UI.WebControls.Image)ctrl).Visible = false;
                    }
                }
            }
        }
     
     
        private string GetItemUrl(string val, bool resolveAsAbsoluteUrl)
        {
            if (val.StartsWith("~/"))
                return this.ResolveUrl(val);
     
            if (val.StartsWith("["))
            {
                int idx = val.IndexOf("]");
                string provider = val.Substring(1, idx - 1);
                string strId = val.Substring(idx + 1);
                Guid id = new Guid(strId);
     
                if (ContentManager.Providers.ContainsKey(provider))
                {
                    IContent cnt = ContentManager.Providers[provider].GetContent(id);
                    if (cnt != null)
                        return VirtualPathUtility.ToAbsolute(cnt.UrlWithExtension, this.Context.Request.ApplicationPath);
                }
                else
                {
                    string url = CmsHelper.GetPageUrl(id, this.Context);
                    if (!string.IsNullOrEmpty(url))
                    {
                        return url;
                    }
                }
                return String.Concat("Item not found: [", provider, "]", id);
            }
            return val.ToString();
        }
    }



    You will find a sample video that shows how the image is correctly displayed and mapped

    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.
  16. Jay Mehta
    Jay Mehta avatar
    19 posts
    Registered:
    02 Sep 2009
    27 May 2010
    Link to this post
    Thanks Ivan.

    I get error on the CmsHelper.GetPageUrl........is the GetPageUrl custom method?


    Thank you,
    Jay Mehta.
  17. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    27 May 2010
    Link to this post
    Hi Jay Mehta,

    Add a reference to Telerik.Cms.Web in your control:
    using Telerik.Cms.Web;

    Also check your Sitefinity version. In older versions(prior to Sitefinity 3.7 the method call is with only one parameter - the page ID.

    Sincerely yours,
    Radoslav Georgiev
    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.
  18. Jay Mehta
    Jay Mehta avatar
    19 posts
    Registered:
    02 Sep 2009
    27 May 2010
    Link to this post
    Thanks Ivan for the quick reply.

    I had added that reference.

    The version we are using is 3.6, and thats why I think the method does not work. But if it is expecting only 1 parameter, it should throw that error rather then method not found.

    Do I need to create that method?

    Thank you,
    Jay Mehta.
  19. Jay Mehta
    Jay Mehta avatar
    19 posts
    Registered:
    02 Sep 2009
    14 Jun 2010
    Link to this post
    Hi,

    Any updates on this? I still was not able to achieve the functionality.

    Thank you,
    Jay Mehta.
  20. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    15 Jun 2010
    Link to this post
    Hello Jay Mehta,

    Try calling the method only with ID arguement.

    Best wishes,
    Radoslav Georgiev
    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.
  21. aaron
    aaron avatar
    2 posts
    Registered:
    23 Sep 2008
    29 Jun 2010
    Link to this post
    Hello Radoslav Georgiev
     
    I have been trying too add an image to the blog post using the technique used in this post.  I can upload the image fine but the thumbnail is never displayed for the blogs posts.  I think I am stuck at registering the app_code class in the web.config.  I am unsure where to add this?

    Many thanks
  22. Siddesh Kapadi
    Siddesh Kapadi avatar
    239 posts
    Registered:
    09 Oct 2009
    29 Jun 2010
    Link to this post
    hey Aaron,
    Add the same in the toolboxControls section. Something similar to the below would already be available.

    <add name="Video" section="Most popular" type="Telerik.Libraries.WebControls.Video, Telerik.Libraries" description="Video content control"/>

    Regards,
    Siddesh Kapadi
  23. Trevor
    Trevor avatar
    17 posts
    Registered:
    06 Sep 2010
    17 Nov 2010
    Link to this post
    Hi,

    I would just like to follow up on the last questions asked about finishing this project off by adding it to the web.config. I've been trying unsuccessfully to get the code to load through the toolbox, I constantly receive an error along the lines of: Error Loading Control.

    using System;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using Telerik.Blogs.WebControls;
    using Telerik.Cms.Engine;
    using Telerik.Cms.Web;

    using System;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using Telerik.Blogs.WebControls;
    using Telerik.Cms.Engine;
    using Telerik.Cms.Web;
     
    namespace Telerik.Blogs.WebControls
    {
        public class CustomBlog : BlogPosts
        {
            public CustomBlog()
            {
            }
            public override string SingleItemTemplatePath
            {
                get
                {
                    return "~/Sitefinity/ControlTemplates/Blogs/Modes/ListPageDetail.ascx";
     
                }
     
            }
            ...
    }

    And then I try and reference it as follows in the web.config

    <toolboxControls>
            <clear />
    <add name="Custom Blog" section="Most popular" type="Telerik.Blogs.WebControls.CustomBlog, Telerik.Blogs" description="Custom Blog Module" />:
    </toolboxControls>

    I would really appreciate a pointer into the right direction. Thanks.
  24. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    17 Nov 2010
    Link to this post
    Hi Trevor,

    The assembly you use Telerik.Blogs is not correct

    type="Telerik.Blogs.WebControls.CustomBlog, Telerik.Blogs"

    Your class library should not be called Telerik.Blogs.

    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
  25. Trevor
    Trevor avatar
    17 posts
    Registered:
    06 Sep 2010
    17 Nov 2010
    Link to this post
    Hi Ivan,

    Thank you for your reply. Could you please help me with an example of how the web.config line should look as well as the code it references.

    At the moment I've tried to change it to the following:

    namespace CustomModule
    {
        public class CustomBlog : BlogPosts
        {
            public CustomBlog()
            {
            }
            public override string SingleItemTemplatePath
            {
                get
                {
                    return "~/Sitefinity/ControlTemplates/Blogs/Modes/ListPageDetail.ascx";
     
                }
    ...
    }

    And then
    <add name="Custom Blog" section="Most popular" type="CustomModule.CustomBlog, CustomModule"
              description="Custom Blog." />

    This Code is directly inside the App_Code directory.
  26. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    17 Nov 2010
    Link to this post
    Hi Trevor,

    The parameters of the toolbox control are

    name - control name
    section - section where you want to see your control in the Toolbox
    type - control type in format Namespace, AssemblyName
    description - short description about the control

    sample


    <add name="some name" section="Custom"  type="CustomModule.CustomBlog ,CustomModule"/>

    If your class library is  called CustomModule there this is what you have to add as an assembly name(highlighted with yellow).

    When you are inheriting from ContentView control you should override both template paths - for list mode and details mode as my code shows.

    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
  27. Trevor
    Trevor avatar
    17 posts
    Registered:
    06 Sep 2010
    17 Nov 2010
    Link to this post
    Hi Ivan,

    Thank you for your very detailed response, it really helped clear things up. I am just still puzzling how I should set the Type when I'm using code from the App_Code.

    I've successfully got it running from a Class Project I created and then referencing that class file. But what do I do if I use App_Code

    example: <add name="some name" section="Custom"  type="CustomModule.CustomBlog ,???"/>
  28. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    17 Nov 2010
    Link to this post
    Hi Trevor,

    Use

    type="MyType, App_Code"

    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
  29. Trevor
    Trevor avatar
    17 posts
    Registered:
    06 Sep 2010
    17 Nov 2010
    Link to this post
    Thanks Ivan, you're the best! That's exactly what I needed!
  30. Iain
    Iain avatar
    26 posts
    Registered:
    29 Dec 2010
    31 Jan 2011
    Link to this post
    Could you provide an example of how to edit the resx file?

    Or point me in the right direction...?
Register for webinar
43 posts, 0 answered
1 2