Automatically setting ControlTemplates for custom themes
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?
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
I can't seem to find the setting in the administration, but I've found:
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
Ah, for some reason I missed the Toolbox section.
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?
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
Sounds great, this will be a real time saver in the final product.