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

Forums / Developing with Sitefinity / How do I map an external template to the templatePropertiesTemplate

How do I map an external template to the templatePropertiesTemplate

6 posts, 1 answered
  1. Tom
    Tom avatar
    19 posts
    Registered:
    15 Sep 2009
    18 Feb 2010
    Link to this post
    I intend to map an external template to the templatePropertiesTemplate with the following lines in App_Data/Configuration/Telerik.Sitefinity.Configuration.ControlsConfig.xml:

    <?xml version="1.0" encoding="utf-8" ?>
    <controlsConfig>
      <viewMap>
        <viewSettings hostType="Telerik.Cms.Configuration.SectionHandler">
          <additionalTemplates>
            <add key="templatePropertiesTemplate" layoutTemplatePath="~/Custom/Sitefinity/Admin/ControlTemplates/PageTemplates/TemplateProperties.ascx" />
          </additionalTemplates>
        </viewSettings>
      </viewMap>
    </controlsConfig>

    This doesn't have any effect. Am I missing anything out?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    18 Feb 2010
    Link to this post
    Hello Tom,

    This  template ~/Custom/Sitefinity/Admin/ControlTemplates/PageTemplates/TemplateProperties.ascx" could not be mapped. The template is located in the same location as the path shows. This is not embedded template.

    Regards,
    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
  3. Tom
    Tom avatar
    19 posts
    Registered:
    15 Sep 2009
    19 Feb 2010
    Link to this post
    Hi Ivan

    Thanks for your reply! According to the attribute for the TemplatePropertiesTemplate as below it seems like an external template could be configured via web.config, right?

    [StringValidator, ConfigurationProperty("templatePropertiesTemplate", DefaultValue="~/Sitefinity/Admin/ControlTemplates/PageTemplates/TemplateProperties.ascx")]

    If so, how and where does this have to be done?

    Kind regards,
    Tom
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    19 Feb 2010
    Link to this post
    Hello Tom,

    You will need a custom module that has a class which inherits from ConfigurationElement. In your custom class you can implement a public property which you will be able to change through the web.config file

    [ConfigurationProperty("sampleTemplate", DefaultValue = "~/Sitefinity/Admin/ControlTemplates/sampleTemplate.ascx", IsRequired = false)]
       public string SettingTemplate
       {
           get
           {
               return (string)this["sampleTemplate"];
           }
           set
           {
               this["sampleTemplate"] = value;
           }
       }


    All the best,
    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.
  5. Tom
    Tom avatar
    19 posts
    Registered:
    15 Sep 2009
    19 Feb 2010
    Link to this post
    Hi Ivan

    Thanks for your response! So if I get you right, I should be able to overwrite the default template for TemplatePropertiesTemplate using the web.config:

    <add key="templatePropertiesTemplate" value="~/CustomizedTemplateProperties.ascx" />

    But where (which section) do I have to place this entry in order to overwrite the template?

    Kind regards,
    Tom
  6. Tom
    Tom avatar
    19 posts
    Registered:
    15 Sep 2009
    28 Feb 2010
    Link to this post
    I ran into this problem once again. Therefore Ivan gave me some overall instructions how to handle the different types of templates here: http://www.sitefinity.com/support/forums/sitefinity-3-x/developing-with-sitefinity/use-a-custom-template-instead-of-the-ootb-searchresult-ascx.aspx#1106504
Register for webinar
6 posts, 1 answered