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

Forums / Set-up & Installation / Getting templates recognized from ControlsConfig

Getting templates recognized from ControlsConfig

4 posts, 0 answered
  1. Jules
    Jules avatar
    65 posts
    Registered:
    20 Jul 2005
    23 Apr 2009
    Link to this post
    Let me preface this by saying I have successfully gotten my own versions of the NewsView templates to be recognized and implemented using the ControlsConfig file. I actually like this system -- it makes it easy for me to keep all of my own versions in one place and see very quickly what controls I've customized.

    However, now I'm trying to implement my own version of EventsView. I've updated my templates, double-checked on the resource files, and then updated ControlsConfig (see below for code). I've altered my web.config to force a reset, and when I didn't see the changes implemented, I went ahead and recycled IIS. Still nothing. Sitefinity continues to use the embedded template for the EventsView (but is using my custom version of NewsView.)

            <viewSettings hostType="Telerik.News.WebControls.NewsView"
                <additionalTemplates> 
                    <!--Provides user interface for displaying a list of news items in the NewsView control for the News module.--> 
                    <add key="ItemListTemplatePath" layoutTemplatePath="~/UserControls/MySitefinityControlTemplates/News/ListPageMaster.ascx" /> 
                    <!--Provides user interface for displaying a single news item in the NewsView control of the News module.--> 
                    <add key="SingleItemTemplatePath" layoutTemplatePath="~/UserControls/MySitefinityControlTemplates/News/ListPageDetails.ascx" /> 
                </additionalTemplates> 
            </viewSettings> 
          <!-- Replaces EventsView control.--> 
          <viewSettings hostType="Telerik.Events.WebControls.EventsView"
            <additionalTemplates> 
              <!--Item List--> 
              <add key="ItemListTemplatePath" layoutTemplatePath="~/UserControls/MySitefinityControlTemplates/Events/ContentViewItemView.ascx" /> 
              <!--Single Item--> 
              <add key="SingleItemTemplatePath" layoutTemplatePath="~/UserControls/MySitefinityControlTemplates/Events/ContentViewSingleItemView.ascx" /> 
            </additionalTemplates> 
          </viewSettings> 
     


    Anyone experience something similar? Have any ideas how to fix?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    24 Apr 2009
    Link to this post
    Hello Julia Essex,

    Map the templates directly through EventsView controls designer. Under advanced tab, appearance set  SingleItemTemplatePath(ListPageDetail template) and ItemListTemplatePath( ListPageMaster template) to point to your templates. Generally you do not need to map presentation modes through Controlsconfig file.

    You may also find the following post useful Mapping ContentViewDesigners and working with Presentation Modes

    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Jules
    Jules avatar
    65 posts
    Registered:
    20 Jul 2005
    24 Apr 2009
    Link to this post
    Ok, that's great, BUT....  I actually liked that the ControlsConfig lets me replace the display universally – some of these controls, like the EventsView, leave me scratching my head as to what your developers were thinking (like displaying a publish date in an event listing, but not a start date. What???? not the poitn. that's why you give me tools to customize it to my brand of logical.) I'm sure I'll start tinkering with the designer interfaces too, but I haven't gone there yet. Anyway, also, I'm not really going to teach my site's content updaters to map a control template to my own version of it.

    So.... if I use the other method outlined in the article you referenced, I'm to map to a custom version of the designer just so I can change the presentation mode templates? If that's what I have to do, ok, but then why is there a mapping in ControlsConfig at all for the presentation templates? How am I supposed to know when to use ControlsConfig for presentation templates and when to map custom designers too?

    J

  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    27 Apr 2009
    Link to this post
    Hello Julia Essex,

    There is a ladder of given priorities to the templates.

    1. Inline template declaration
    2. Layout template path
    3. Controls Config
    4. Embedded template.


    So, we distributed the ControlsConfig file with all host types and prepared several articles in our blog to show the users how they need to work with ControlsConfig file and presentation modes. Generally, when you want to changed one of the presentation mode you should use the control designer properties. For all other templates you can use ControlsCponfig file. There are several templates that we have added for backward compatibility( example :ContentViewSingleItem - you can use ListPageDetail tempalate)

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
4 posts, 0 answered