Try Now
More in this section
Blogs RSS feed

Sitefinity 3.6 beta - Mapping views to use external templates

by Ivan Osmak
Yesterday we have released Sitefinity 3.6 beta and one of the major new improvements are embedded control templates. By embedding templates we were able to drastically reduce the number of files that comes with Sitefinity website, but even more importantly, we have ensured that on upgrades we do not override your customized templates anymore.

How does it work?

So the question is: if we have embedded templates, does this mean you will not be able to modify templates anymore? Are you stuck with whatever template we have embedded? No, of course not.


When you wish to change a template, you can map the view (view is technically just a control, but there is a difference here in this new way of thinking of controls, that I will elaborate on in one of the future posts) to use external template instead of the embedded one.

How to map a view to an external template?

First thing we need to do is add controls configuration file. To do so, do following:
  1. Create a new folder in App_Data folder and name it Configuration
  2. Create a new file in Configuration folder and name it Telerik.Sitefinity.Configuration.ControlsConfig.xml
  3. Set following XML in the file in order to map ContentItemNew view to use your external template:
    <?xml version="1.0" encoding="utf-8" ?> 
        <viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.ContentItemNew`1[[Telerik.Cms.Engine.WebControls.Admin.ContentItemsView, Telerik.Cms.Engine, Version=3.1.3311.24714, Culture=neutral, PublicKeyToken=85fd314cb21bc432]]"  
  4. Create the file for your external template and that is it.
While you have this declaration in this config file, Sitefinity will always use your external template as opposed to an embedded one. When you upgrade, Sitefinity will not come with any template files so there is no risk of losing your modifications.

How do you know hostType of the view you want to change?

You don’t. In Sitefinity 3.6 we will ship reference files of all views and their types for your convenience so you can easily copy and paste viewSettings declaration for the files you wish to change. While we believe this new feature is quite powerful and will solve many problems, we are aware that it is far away from a “user friendly”, therefore in Sitefinity 4.0 we will provide a graphical user interface for managing views.

I do not want to write the template from the scratch – I just want to modify it

Understandably, since templates will be embedded, how do you only modify a template. Once again, for the transition period between 3.6 and 4.0 we will provide all templates in a separate zip file, so that you can simply pull a template you need, modify it and map a view to it. In Sitefinity 4.0 template exporter tool is planned which will be part of the same graphical user interface for mapping views to external templates.

You can download the files I’ve talked about in this post from here.

Stay tuned for more posts about Sitefinity 3.6 beta.


Leave a comment
  1. Romi Jan 24, 2009
    Hi Team, Hi Ivan,

    Thanks for this post. Could you simplify the complexe method to link the hostType? You will generate many post about how to link this or that. It's not possible to use tags like <news>, <forum> to link the corrects hostTypes backside. Don't forget add one full map for the user that unknow the templates that u use. In the furure if u know only the version bigest that 3.6 you are not study the oldest templates. Regards
  2. Chanan Zass Jan 25, 2009
    Seems like a great concept.
    My only concern is about our ability to localize certain templates that so far (we use version 3.5 SP1) have not been open to the use of local or global resources.
    To resolve this, we have edited the templates, inserting labels that use outside resources.
    I do hope that the new embedded templates would be open to the use of outside resources (either local or global; we prefer as a rule global resources that allow us to give translation services a single file to translate).

    Looking forward eagerly to this new version.

  3. Ivan Jan 25, 2009
    I am glad that you like the concept.
    Localization is indeed one of the weak spots of Sitefinity and we have recognized it. In Sitefinity 3.6 I am afraid that you will have to do some work if you wish to change the way resources work - however you can leave a support ticket with your particular scenario and we'll try to find the best solution. In Sitefinity 4.0, however, we will completely overhaul the localization. I am not at liberty to go into details here, but I'll just say that it is going to relieve all your pain :) - and we'll be especially friendly to clients using translation services.
  4. Hardy Feb 03, 2009
    Thanks, Ivan.

    In your reponse to Chanan's comment above you said "Localization is indeed one of the weak spots of Sitefinity and we have recognized it". Does this mean that version 3.6 makes it harder to localize a site than previous versions did?
  5. Larry Feb 13, 2009
    >  In Sitefinity 3.6 we will ship reference files
    > of all views and their types for your
    > convenience...

    > ... we will provide all templates in a separate zip file ...

    Sitefinity 3.6 has shipped. Are the cited resources available yet?
  6. Joey Feb 16, 2009
    The only resources I've found cause this:

    Could not load file or assembly 'Telerik.News]]' or one of its dependencies. The system cannot find the file specified. 
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
    Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'Telerik.News]]' or one of its dependencies. The system cannot find the file specified. 

    If anybody knows how to map to an external template for news please let me know.  This is what was in ControlsConfigReference.xml.

        <!-- Edits a news item --> 
        <viewSettings hostType="Telerik.News.WebControls.Admin.NewsItemEdit`1[[Telerik.News.WebControls.Admin.NewsItemsView, Telerik.News]]" 
        <!-- Inserts a news item --> 
        <viewSettings hostType="Telerik.News.WebControls.Admin.NewsItemNew`1[[Telerik.News.WebControls.Admin.NewsItemsView, Telerik.News]]" 

  7. john mirzaei Oct 11, 2009
    i need sitefinity external templates version 3.6 but in the sitefinity website i can only see external templates 3.7 can u help me please?
    my email: kornmirza@yahoo.com

    Leave a comment