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

Forums / Developing with Sitefinity / Multiple External templates for the itemlistpath

Multiple External templates for the itemlistpath

3 posts, 0 answered
  1. Ali
    Ali avatar
    37 posts
    Registered:
    11 Jun 2008
    31 Aug 2009
    Link to this post
    okay so I have added the controlsconfig file to my app_data and everything is working just fine.

    I was wondering though, is it possible to have MULTIPLE templates, under <additionalTemplates> for the key="ItemListTemplatePath"

    I am getting an error with the code below. If there is no way around this thats fine I can edit the control designer and set up one massive template and use the control designer to specify what is displayed, but i would rather be able to use multiple templates. Please let me know. I am on SF 3.6 SP2.

    Example code:

    <?xml version="1.0" encoding="utf-8"?> 
    <controlsConfig> 
      <viewMap> 
        <!--Provides user interface for editing a news item in the News module.--> 
        <viewSettings hostType="Telerik.News.WebControls.Admin.NewsItemEdit" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/News/NewsItemEdit.ascx" /> 
         
        <!--Provides user interface for adding new news items in the News module.--> 
        <viewSettings hostType="Telerik.News.WebControls.Admin.NewsItemNew" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/News/NewsItemNew.ascx" /> 
     
        <!--Provides templates for displaying news items on the page.--> 
        <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="~/Sitefinity/ControlTemplates/News/ListPageMaster.ascx" />
             
            <!--Provides user interface for displaying a list of news items in the NewsView control for the News module.--> 
            <add key="ItemListTemplatePath" layoutTemplatePath="~/Sitefinity/ControlTemplates/News/PortfolioHomeListPageMaster.ascx" /> 
             
            <!--Provides user interface for displaying a single news item in the NewsView control of the News module.--> 
            <add key="SingleItemTemplatePath" layoutTemplatePath="~/Sitefinity/ControlTemplates/News/ListPageDetails.ascx" /> 
             
          </additionalTemplates> 
        </viewSettings> 
      </viewMap> 
    </controlsConfig> 


  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    31 Aug 2009
    Link to this post
    Hi Ali,

    There are two options to map templates for ContentView based controls and I could not find no one of them in your post.

    Options:

    1. Map the templates using ControlDesigner - Working with Presentation Modes - if you use this way all controls will use one template.

    2. Map templates through ItemListTemplatePath and SingleItemTemplatePath properties of NewsView control- if you use this way you can have different styling and apprarace for each control.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Sachin
    Sachin avatar
    18 posts
    Registered:
    10 Nov 2010
    13 Apr 2012
    Link to this post
    Hi Ivan,

    This is an old thread but I found this one searching for what I am trying to do. I want to have a main news page where there will be the most recent news with thumbnail followed by 3 more recent news (without thumbnails). Also there will be 4 list of news listed in different categories on the same page under the title of the name of the categories. If someone links on categories title, it will take them to another page where I will display news but there wont be list of news from other categories, so here I can't use the template I created for main news page. How can I achieve this? Is it possible to create this using multiple itemlisttemplatepath external templates approach or I have to create user control and use news api to display news in the layout I want?
Register for webinar
3 posts, 0 answered