Mapping Sitefinity Templates from the SDK

There are several different ways to map Sitefinity widgets to external templates, including globally using the ViewMap.  You can also use the built-in Sitefinity Widget Template editor and even Sitefinity Thunder to modify templates and copy them to external files.

However, did you know that a copy of every single widget template is included in the Sitefinity SDK?

When you install the SDK, a zip file named WidgetTemplates.zip, which contains a copy of every usable Sitefinity template is copied to your machine.

By default it is installed to the folder C:\Program Files (x86)\Telerik\Sitefinity [Version]\SDK\Content\Resources where [Version] is the currently installed version of the Sitefinity SDK.

Sitefinity-SDK-Widget-Templates

Simply extract this folder and you’ll have access to all the Frontend, Backend, and public templates for Sitefinity widgets, including all of the Ecommerce controls, as well as the Control designers for each widget.

Sitefinity-SDK-Widget-Template-Files

There are two ways you can use these templates to extend and customize the Sitefinity widgets.

1. Copy the Template Files

If you simply copy and paste the template ascx files into a folder in your project, you can easily map your widget to that template. This is usually done by setting the LayouTemplatePath or TemplatePath property in the Advanced settings for a widget.

For example, if you wanted to map the Content Block widget to a modified custom external template, first copy the file Backend\GenericContent\ContentBlock.ascx to a folder in your project.

Then open the Widget designer for a content block on a Sitefinity page and click the “Advanced” button to access all the widget properties. Finally, simply change the layout template path to point to the virtual path to your custom template file.

Sitefinity-Content-Block-Widget-External-Template

The advantage of copying the template as-is from the SDK directory is that it is immediately available for use; no need to compile or build the solution. Simply point to the template and you're done.

You now have full control over the layout and can customize the markup of your widget, such as adding CSS, scripts, or even html 5 elements like

Enjoyed this post and/or found it useful?
Tagged with:
SelArom Dot Net Profile Image
SelAromDotNet

Josh loves all things Microsoft and Windows, and develops solutions for Web, Desktop and Mobile using the .NET Framework, Azure, UWP and everything else in the Microsoft Stack.

His other passion is music, and in his spare time Josh spins and produces electronic music under the name DJ SelArom.



Scroll to top