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

Forums / Developing with Sitefinity / CategoriesTree.ascx in 3.6

CategoriesTree.ascx in 3.6

6 posts, 2 answered
  1. Dawn
    Dawn avatar
    37 posts
    Registered:
    17 Sep 2012
    19 Aug 2009
    Link to this post
    I am not sure how to modify this control. I put it in the following location

    "~\Sitefinity\ControlTemplates\Events\CategoriesTree.ascx"

    I also set the TemplatePath and LayoutTemplatePath properties with the above path. But I still cannot get my customizations to show up.

    What am I missing?
  2. Dawn
    Dawn avatar
    37 posts
    Registered:
    17 Sep 2012
    19 Aug 2009
    Link to this post
    In addition to the above,

    1. When I click on the links I get taken to a directory  structure view of the webserver. The links seem to be pointing to http://sitename/App_Master/?CntCatID=<GUID> How do I fix this so that it sorts the list?

    2. There is no place in the admin to set the title of the control.

    Robert

  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    19 Aug 2009
    Link to this post
    Hi Robert,

    I am not sure how to modify this control. I put it in the following location
    "~\Sitefinity\ControlTemplates\Events\CategoriesTree.ascx"


    This is a control template used by CategoriesTree control. Could you try to map the template through ControlsConfig file as the sample below illustrates( How to map an view)

    <viewSettings hostType="Telerik.Cms.Engine.WebControls.Categories.CategoriesTree"  
                      layoutTemplatePath="~/Sitefinity/ControlTemplates/Generic_Content/CategoriesTree.ascx" /> 

    1. When I click on the links I get taken to a directory  structure view of the webserver. The links seem to be pointing to http://sitename/App_Master/?CntCatID=<GUID> How do I fix this so that it sorts the lis

    You need to set the following properties of CategoriesTree control
    -
    CategoryKey
    - CategoryContentUrl
    - ProviderName

    2. There is no place in the admin to set the title of the control.

    The control does not expose a property for title. You can use its ID or implement the title. Below is a sample code:
        [Category("TEST")] 
        public string TitleLabel 
        { 
            get { return this.label; } 
            set { this.label = value; } 
     
        } 
        private string label; 
     
     
        protected override void InitializeControls(Control controlContainer) 
            { 
                base.InitializeControls(controlContainer); 
                Label titleLabel = new Label(); 
                titleLabel.Text = TitleLabel; 
                Controls.Add(titleLabel); 
     
            } 

    Another option is declaring the control in the control template and call it from your custom control.

     
            public Label label 
            { 
                get 
                { 
                    return Controls[0].FindControl("Label1"as Label; 
                } 
            } 


    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
    Answered
  4. Dawn
    Dawn avatar
    37 posts
    Registered:
    17 Sep 2012
    19 Aug 2009
    Link to this post
    Thanks for your help Ivan. Everything works except for #1 when I set the properties.

    Here are my values:
    - CategoryKey             -----> CntCatID
    - CategoryContentUrl  -----> ~/eventslist.aspx
    - ProviderName           -----> Events

    When I click on the links I get taken to the eventslist.aspx page but none of the items are sorted. It still shows all events items.
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    19 Aug 2009
    Link to this post
    Hello Robert,

    Use EventCatID for CategoryKey instead of CntCatID.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
    Answered
  6. Dawn
    Dawn avatar
    37 posts
    Registered:
    17 Sep 2012
    19 Aug 2009
    Link to this post
    That worked. Thanks!
Register for webinar
6 posts, 2 answered