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

Forums / General Discussions / Automatically setting ControlTemplates for custom themes

Automatically setting ControlTemplates for custom themes

8 posts, 1 answered
  1. Klemen Slavič
    Klemen Slavič avatar
    30 posts
    Registered:
    24 Jul 2009
    22 Sep 2010
    Link to this post
    Is there a way for controls I drag from the page and template editor onto a page or template to automatically pick up templates from the ControlTemplates directory in my custom theme?

    If not, is there a faster way of setting the TemplatePath property for a given control on a page? I currently set it by going to the Advanced Properties Browser in the Edit Dialog and going through ControlDefinition -> (Template) -> TemplatePath.

    Also, I'm using a copy of DefaultTemplate and haven't renamed files, so they should match the default template.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    22 Sep 2010
    Link to this post
    Hello Klemen,

    Controls that inherit from SimpleView has a public property LayoutTemplatePath which is used for setting the template of a control. You can set this property through your control designer, set the default template from Administration >> Settings >> Toolboxes >> [[your control]] or implement ( override existing)a control which inherits from SimpleView and return the path to your custom template.

    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
  3. Klemen Slavič
    Klemen Slavič avatar
    30 posts
    Registered:
    24 Jul 2009
    22 Sep 2010
    Link to this post
    I can't seem to find the setting in the administration, but I've found:

    Administration -> Settings -> Controls -> ViewMap

    ... which has the LayoutTemplatePath property. Is this the same thing?
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    22 Sep 2010
    Link to this post
    Hi Klemen,

    I attached a screenshot that shows the location of ToolBox section where all controls you have should be added.

    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
    Answered
  5. Klemen Slavič
    Klemen Slavič avatar
    30 posts
    Registered:
    24 Jul 2009
    22 Sep 2010
    Link to this post
    Ah, for some reason I missed the Toolbox section.

    Thanks.
  6. Klemen Slavič
    Klemen Slavič avatar
    30 posts
    Registered:
    24 Jul 2009
    22 Sep 2010
    Link to this post
    I've gone through all the sections in Toolboxes -> PageControls->Sections -> ContentToolboxSection, but I can't find the NewsView, BlogView and EventsView controls that I'm using in my templates. Do I need to extend these classes and use those to set the layout template path or am I missing something?
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    22 Sep 2010
    Link to this post
    Hello Klemen,

    For these controls , you can use LayoutTempaltePath property. These controls are not added to the Settings configuration, because they are initialized together with a module ( News, Blogs, Events) initialization and added to the memory. We have logged a task to find a way to add all controls in Toolboxes -> PageControls->Sections. This is just a limitation in the BETA.

    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
  8. Klemen Slavič
    Klemen Slavič avatar
    30 posts
    Registered:
    24 Jul 2009
    22 Sep 2010
    Link to this post
    Sounds great, this will be a real time saver in the final product.
8 posts, 1 answered