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

Forums / Suggestions / Featured News

Featured News

4 posts, 0 answered
  1. Meister
    Meister avatar
    262 posts
    Registered:
    09 Nov 2007
    14 Dec 2009
    Link to this post
    This may be possible already but not sure, so if it is would appreciate a quick suggestion on how to implement

    We have a client who wants to have greater control over the news section, and in particular they want to be able to specify which news items to show
    e.g. they may drag 2 news controls on the page
    the first control is set to a certain category but only shows items 1-5
    the second control is exactly the same but shows items 6-100 (or all remaining news in category)

    its would be good to have a bit of positioning control over these 2 news controls
    Ideally we'd like them to display differently (e.g. position/size of thumbnail)
    However, this may be possible to do with CSS and specificity

    Think of the first 5 news items as featured news, and the rest are ones that are a bit older.



  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    14 Dec 2009
    Link to this post
    Hello Quade,

    You need two controls.

    To show the latest 6 items you can use the built in implementation

    1. Set SortExpression of NewsView control to  Publication_Date DESC

    2. Under NewsSettings set Limit the number of items for the entire list to 6

    For the second control that will show items from 6 - 100 you need to create a custom control that gets the content items using GetContent method.

    IList sortedItems = manager.GetContent(6, 100, "Publication_Date DESC");

    The control should inherit from NewsView and you should override  the following method.

    protected override System.Collections.IList CreateDataSource(int startIndex, int itemsPerPage)
       {
           return base.CreateDataSource(startIndex, itemsPerPage);
       }


    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. Meister
    Meister avatar
    262 posts
    Registered:
    09 Nov 2007
    17 Dec 2009
    Link to this post
    Thanks Ivan

    For the 2nd control, will that have all the features of the current news view control or will it just be a basic version?

  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    17 Dec 2009
    Link to this post
    Hello Quade,

    If you inherits from NewsView as suggested the custom control will have all features plus the custom implementation.


    Kind regards,
    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.
Register for webinar
4 posts, 0 answered