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

Forums / Developing with Sitefinity / Customising HTML output of CategoriesList and Archive control

Customising HTML output of CategoriesList and Archive control

5 posts, 0 answered
  1. Lyn
    Lyn avatar
    15 posts
    Registered:
    30 Apr 2008
    25 Nov 2008
    Link to this post
    Hi,

    In 3.5 we have notices you have changed from a bulleted list in the archive control to a radtreeview - great is some ways, terrible in others as you can now not really control what sort of output you want your archive to out like - you are stuuck with either drop down or radtreeview.

    Anyway we want to make both the HTML output of the CategoriesList and the ArchiveList (News in this case) exactly the same - smething which currently seems a little impossible for the following reasons:

    • 1. The CategoriesList puts the ItemCount outside of the href whereas the archiveList buts the ItemCount inside the href. I think it would be best to keep these things consistent eg. for these sorts of controls tagList, CategoriesList, ArchiveList etc keep the ItemCount inside th href.

    • 2. The CategoriesList outputs a bullet list and the Archive control outputs in a radtreeview.

    • 3. Both these controls don't allow you much room to control the HTML output.

    • We have created a single Control called NewsNavigation (see link to example below) which utilises both the CategoriesList control and the NewsArchive Control We would like to output the html something like this:

    <div class="SubNavigation"
    <div class="section"
    <h2><span class="label">Section navigation: </span><a href="#">News archive</a></h2
    </div> 
    <h3>By category</h3> 
    <ul class="rpRootGroup"
    <li><a href="#" class="rpSelected"><span class="rpText">Media releases (3)</span></a></li> 
    <li><a href="#"><span class="rpText">Coal (5)</span></a></li> 
    <li><a href="#"><span class="rpText">Freight (4)</span></a></li> 
    </ul> 
    <h3>By date</h3> 
    <ul class="rpRootGroup"
    <li><a href="#" class="rpSelected"><span class="rpText">July 2008 (3)</span></a></li> 
    <li><a href="#"><span class="rpText">June 2008 (5)</span></a></li> 
    <li><a href="#"><span class="rpText">May 2008 (4)</span></a></li> 
    <li><a href="#"><span class="rpText">April 2008 (9)</span></a></li> 
    <li><a href="#"><span class="rpText">March 2008 (4)</span</a></li>                                     
    <li><a href="#"><span class="rpText">February 2008 (3)</span></a></li> 
    <li><a href="#"><span class="rpText">Older (24)</span></a></li> 
    </ul> 
    </div> 


    Can someone tell us how can we achieve this?

    Many Thanks
    •  
  2. Lyn
    Lyn avatar
    15 posts
    Registered:
    30 Apr 2008
    26 Nov 2008
    Link to this post
    Hi,

    Anyone got any ideas on this post?

    Thanks

    Seth
  3. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    28 Nov 2008
    Link to this post
    Hi Seth,

    The RadTreeView is rendering its output as an unordered list. The only way to change this behaviour is by creating a control adapter for it. Please note that the control adapter will affect all instances of this control, which means that the Page Tree in the administration would be also changed.
    The only other thing we could suggest you in order to change the HTML output is to built your own user controls. You can take whatever you want with the APIs and to render it in the way you would like.

    Greetings,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  4. gavin
    gavin avatar
    3 posts
    Registered:
    30 Jan 2009
    02 Feb 2009
    Link to this post
    Has anybody tried and/or succeded applying a control adapter to a radtreeview in order to change some of the markup in a siteTreeView.
    Any hints and/or examples would be greatly apreciated.
  5. gavin
    gavin avatar
    3 posts
    Registered:
    30 Jan 2009
    04 Feb 2009
    Link to this post
    This has now been resolved. There was an issue however where any changes made to the markup of RadTreeview (using a control adapter) would be applied to all RadTreeViews in the site (including the site map).

    To get around this problem I created a subclass of RadTreeView and specified that in the BrowserFile.browser file instead of RadTreeView. This way I was able to control which RadTreeViews were adapted.
Register for webinar
5 posts, 0 answered