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

Forums / Developing with Sitefinity / filtering news list by category

filtering news list by category

9 posts, 0 answered
  1. Nick
    Nick avatar
    91 posts
    Registered:
    04 Aug 2008
    04 Aug 2008
    Link to this post
    i have a News List on a page and wish to filter so that it only displays say the 3 most recent stories from Category X. There are over 3 news items that are members of Category X but when i set the News List to only display items in this Category, other items trickle through.

    I have just done some further investigation into this matter (namely trawling the news items and checking they're actually members of the categories they're supposed to be), and i have noticed that news items don't seem to be retaining the category to which they are assigned (no matter how many times i re-assign them!)

    has anybody else found this problem? i have taken over the CMS at my company from someone else and thus i do not know whether they have altered any of the configuration to disregard category information.

    any help on this matter would be much appreciated.

    Thanks,
    Nick
  2. Joe
    Joe avatar
    138 posts
    Registered:
    24 Sep 2012
    05 Aug 2008
    Link to this post
    Hi Nick,

    Thanks for contacting us.

    Our NewsList control has a bug where category filtering does not work. This was fixed in our Service Pack 2 release. Since the NewsList control is no longer offered in the Sitefinity toolbox, you are likely using a a version before our second service pack. Our latest release is Sitefinity 3.2 SP2 Hotfix 1616 and you can upgrade your project by following these upgrade instructions. Once you upgrade, use the NewsView control instead of the NewsList control.

    I hope that upgrading solves your technical issue. Feel free to contact us if you have any questions.

    All the best,
    Joe
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Nick
    Nick avatar
    91 posts
    Registered:
    04 Aug 2008
    05 Aug 2008
    Link to this post
    i thought that might be the problem in all honesty. applied the update and it's now working like a charm! cheers guys :-)

    no doubt i'll be back with more problems in future tho! ;-)
  4. nogatek
    nogatek avatar
    35 posts
    Registered:
    23 Apr 2008
    12 Aug 2008
    Link to this post
    Hi there,

    I have been trying for quite a while to work out how to filter a News View control programmatically? I have implemented code to create the NewCatID for the querystrings, so just need to implement some code in the News View that takes the Category and filters the list view.

    Do I need to override/extend the News View control? I was hoping there might be a simpler solution...

    Thanks, Mark
  5. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    12 Aug 2008
    Link to this post
    Hello Mark,

    No, you don't need to override the NewsView control. All you have to do is the following:

    1. Open the NewsView control and switch to the Advanced tab.
    2. Make sure that the value of the CategoryKey property is the same as the key of the querystring you are creating (at the Behavior tab).
    3. Make sure that the value of the CategoryKeyType property is set to ID (at QueryStringKeys tab).

    Your control should now be working as expected.

    I hope you'll find this information helpful. Let us know if there is anything else we can do for you.

    Sincerely yours,
    Ivan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. nogatek
    nogatek avatar
    35 posts
    Registered:
    23 Apr 2008
    13 Aug 2008
    Link to this post
    Thanks Ivan.

    I carefully checked the settings you suggested, but the news list is still not filtering by categories (though it is filtering by tags just fine).

    Here is an example URL. All the query strings have been manually appended.

    http://localhost/StaySmart/BrainTraining/AcademicRetail/News.aspx?NewsCatName=Videos&NewsCatID=29488f94-ce28-4792-9a2d-4b6f61a59cf9&NewsTagID=c81ed5c2-9708-4daf-b8d5-b8edd05a3d35

    So as you suggested, I made sure the Behavior > CategoryKey is 'NewsCatID' and the Querystrings > CategoryKeyType is set to 'ID'.

    Is there anything else you can think of that I need to check?

    Thanks, Mark
  7. Nikifor
    Nikifor avatar
    232 posts
    Registered:
    18 May 2013
    14 Aug 2008
    Link to this post
    Hi Mark,

    Currently, the News View control can filter either by tags or categories. This is a known issue for the current version which is already fixed. This fix will make it into the next official release, meanwhile we suggest you use only one kind of filtering the data.
    If after disabling the tags filtering you are still not able to filter by categories, please check out the following KB article: Filtering content by categories in controls based on Content View

    Please let us know if you need any further help.

    Regards,
    Nikifor
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  8. nogatek
    nogatek avatar
    35 posts
    Registered:
    23 Apr 2008
    19 Aug 2008
    Link to this post
    Thanks Nikifor,

    I have found a temporary work around to filter by categories AND tags, though I had to disable paging. This will do for a while.

    So the next question is - when is the next official release planned?

    Mark
  9. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    19 Aug 2008
    Link to this post
    Hi Mark,

    We have not yet set the publicly available date, therefore I am not at liberty to give any information about that. However, it will be reasonably soon; we are working very hard on the next release. Stay tuned... we'll try to come out publicly with this as soon as possible.

    Thank you for getting in touch with us. Let us know if there is anything else we can do for you.

    Best wishes,
    Ivan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
9 posts, 0 answered