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

Forums / General Discussions / Control Templates

Control Templates

7 posts, 2 answered
  1. Kelly
    Kelly avatar
    24 posts
    Registered:
    05 May 2010
    21 Jun 2010
    Link to this post
    I am trying to modify the control templates for News and Events, but when I tried to modify the templates in ~/sitefinity/controltemplates/News or ~/sitefinity/controltemplates/Events it did not effect the control I am using in my website. The control has to be pulling the template from somewhere, has anyone else experienced this, or have a suggestion on where i should look?

    Thanks!
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    21 Jun 2010
    Link to this post
    Hi Kelly Andreae,

    Have you mapped the control templates?

    1. Using ControlsConfig file - how to map a template

    2. Map the templates directly through the control - go the its advanced tab and expand Appearance properties category. There are two properties - SingleItemTemplatePath and ItemListTemplatePath that you can use. This is useful when you want to have multiple controls of the same type - say EventsView, but with different templates for the list and design modes. Note that when you remove the control from a page the properties will be reset.

    3. The second option is mapping the control designer template and then the templates through it. This is described in this post Working with presentation modes
    You can use this way when you want to have the same appearance of all instances of your control and you do not have to set the templates each time- just drag and drop the control and templates will be loaded automatically.

    The following post explains the views hierarchy. Please take a look at the diagram.




    Greetings,
    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. Kelly
    Kelly avatar
    24 posts
    Registered:
    05 May 2010
    21 Jun 2010
    Link to this post
    I set the path to the external template in the necessary control property (Edit Control -> Appearance), but I am now receiving an error message. "A required control was not found in the template for "~/Sitefinity/ControlTemplates/News/NewsList.ascx". The control must be assignable form type "System.Web.UI.WebControls.Repeater" and must have ID "repeater".
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    21 Jun 2010
    Link to this post
    Hello Kelly Andreae,

    The templates that you should use are ListPageMaster and ListPageDetails You will find them under

    [Sitefinity_3_7_standard_ExternalTemplates]Sitefinity\ControlTemplates\News

    You should also add the resx files for these templates.

    Greetings,
    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
  5. Kelly
    Kelly avatar
    24 posts
    Registered:
    05 May 2010
    21 Jun 2010
    Link to this post
    Thank you! That worked perfectly.
  6. Kiran
    Kiran avatar
    12 posts
    Registered:
    14 Sep 2010
    01 Dec 2010
    Link to this post
    Hello

    I am trying to use a control template for blog posts list view. I have the below configuration code in Telerik.Sitefinity.Configuration.ControlsConfig.xml under ~/App_Data/Configuration folder. But the template is not applied.

    <?xml version="1.0" encoding="utf-8"?>
    <controlsConfig>
        <viewMap>
            <viewSettings hostType="Telerik.Blogs.WebControls.BlogPosts">       
                 <additionalTemplates>
                     <!--Provides user interface for displaying a list of posts in the BlogPosts control in the blogs module.-->
                    <add key="ItemListTemplatePath" layoutTemplatePath="~/Sitefinity/ControlTemplates/Blogs/ContentViewItemList.ascx" />
                     <!--Provides user interface for displaying a single post in the BlogPosts control in the blogs module.-->
                    <add key="SingleItemTemplatePath" layoutTemplatePath="~/Sitefinity/ControlTemplates/Blogs/ContentViewSingleItem.ascx" />
                </additionalTemplates>           
            </viewSettings>
        </viewMap>
    </controlsConfig>

    And I have noticed it working when I write the below code in the configuration file. But it is giving me exception when we open a post by clicking Full Story link.

    <?xml version="1.0" encoding="utf-8"?>
    <controlsConfig>
        <viewMap>
            <viewSettings hostType="Telerik.Blogs.WebControls.BlogPosts" layoutTemplatePath="~/Sitefinity/ControlTemplates/Blogs/ContentViewItemList.ascx">       
            </viewSettings>
        </viewMap>
    </controlsConfig>

    Please give me a solution which solves my problem.

    Thanks,
    Kiran
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    01 Dec 2010
    Link to this post
    Hello Kiran,

    Can you try to map the template from the public property of the control - ItemListTemplatePath or through its control designer as described in this post Working with presentation modes

    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
Register for webinar
7 posts, 2 answered