More in this section

Forums / Developing with Sitefinity / customize the newsarchive control

customize the newsarchive control

4 posts, 0 answered
  1. GV
    GV avatar
    33 posts
    Registered:
    11 Sep 2009
    22 Feb 2010
    Link to this post
    Good morning,

    I'm trying to customize the newsarchive control to display in <ul> tags. I modified the layout template property to my desired .ascx file. I also modified the controlsconfig.xml file. But it is not picking up my new template. Any changes made to the template (like adding a simple text) is not reflecting. Can you please suggest me where I'm doing it wrong?

    Thanks & regards
    GV
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    22 Feb 2010
    Link to this post
    Hello GV,

    The NewsArchive template should be mapped through Telerik.Sitefinity.Configuration.ControlsConfig.xml as shown below.

    <viewSettings hostType="Telerik.News.WebControls.NewsArchive" layoutTemplatePath="~/Sitefinity/ControlTemplates/News/ArchiveTemplate.ascx" />

    Then you have to restart the application, otherwise the custom template will not be loaded.

    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.
  3. GV
    GV avatar
    33 posts
    Registered:
    11 Sep 2009
    26 Feb 2010
    Link to this post
    Thanks Ivan,

    That worked. I have an other issue. Can I change the way the NewsArhive renders. I want to have a clean html with a collapsible  <UL> and <LI> list.  I tried to modify the template, but of no use.
    Can you please provide me some example for this?

    Thanks & regards
    GV
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    26 Feb 2010
    Link to this post
    Hello GV,

    There are two modes that this control uses

    1. TreeView - where RadTreeView control is used. Generally you cannot make changes the way of the RadTreeView nodes rendering. You can create some custom classes or wrap the control inside a table.

    2. OptgroupDropDownList - this is a custom control that inherits from DropDownList. You can change the render by overriding RenderContents method.

    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
4 posts, 0 answered