More in this section

Forums / Developing with Sitefinity / Filter NewsArchive by categories

Filter NewsArchive by categories

4 posts, 0 answered
  1. Szymon
    Szymon avatar
    22 posts
    Registered:
    04 Jan 2008
    13 Jul 2008
    Link to this post
    Hi,

    I have a page that uses NewsView to show posts from a specified category only. Next to it I would like to place a NewsArchive control. The problem is that by default it shows the dates for all posts and I couldn't find a way to filter it by categories the same way as I did on the NewsView control. As a result for some months the filtered list is empty which doesn't look good.
    Any idea how to fix this?
  2. Nikifor
    Nikifor avatar
    232 posts
    Registered:
    18 May 2013
    15 Jul 2008
    Link to this post
    Hello Szymon,

    Correct us if we are wrong but our understanding is that you want to filter a list of categories which should lead to the news headlines storage. The news archive control is good when you want to filter the News by their publication date but still, the scenario you describe can not be achieved easily with it. We recommend using the Categories List control, which will result in displaying a list of categories which are link to the exact categorized items (see the attached screenshot). This can be done by:
    1. Placing the control on a page;
    2. Go to Edit the control;
    3. Expand the Data section and input the provider name - News.

    Hope this helps. Please let us know if you have any further questions

    Sincerely yours,
    Nikifor
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Kieran
    Kieran avatar
    56 posts
    Registered:
    14 Aug 2008
    25 Nov 2009
    Link to this post
    Hi

    So  there is now way to have an archive for a specific category of news.

    Eg. I have 2 types of news sports and finance news.

    If I want to display an archive for just sports news. I can add the news module and select the correct news list for sports no problem but when I go to add the news archive is there any way for me to filter the tree by a category (SPORT). As all the news dates appear.


    I'm using  Sitefinity 3.6


    Thanks
    Kieran 
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    26 Nov 2009
    Link to this post
    Hello Kieran,

    You can use FilterExpression property of the control to filter the items by metakey - say "Category". Another option is using two providers - one for Sport and one for Finance. Then change the ProviderName property value. I hope this helps.

    Greetings,
    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