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

Forums / Developing with Sitefinity / Categorizing News

Categorizing News

4 posts, 0 answered
  1. Femy
    Femy avatar
    37 posts
    Registered:
    02 Jan 2008
    09 Oct 2008
    Link to this post
    Hi
    I have  created categories 08,07,06 and created News items and associated them to one of these categories. I created  a page with the NewsView Control and a CategoriesList Control and passed "NewsCatID" for the CategoryKey and CategoryContentURL to the News page. Issues I am having
    1) The categories are listed as
    08 (2)
    07 (0)
    06 (1)
    The number of items in each category is listed next to the category in brackets. What I want is to display the categories as below

    08 | 07 | 06

    How can I get this done

    2)  When I click on each of the categories I want only the News under that category to display in the NewsView control area. Right now it always displays all the News items. I cant seem to figure out how to achieve this. Pls help

    TIA
    FR
  2. Nikola
    Nikola avatar
    51 posts
    Registered:
    24 Sep 2012
    15 Oct 2008
    Link to this post
    Hello Femy,

    You can change the presentation layout of the categories list by modifying the template used by the control (i.e. CategoriesList.ascx) or by creating a copy of the original template and modifying it to exclude the unnecessary elements (Note that the existence of some elements in the template is mandatory, therefore you could just add Visible="false" to hide those elements from showing).

    If you choose to create a custom template, you can point the CategoryList to use it by filling the CategoriesList > Properties > Appearance > TemplateUrl with the relative path to your template (for example, "~/[PathToYourTemplate]/[YourTemplateName].ascx").

    By using custom template you can fully control the look and fill of the elements, including applying custom styling in order to achieve the horizontal positioning of the elements.

    As for displaying News by Category, make sure that you're using the correct CategoryKey as querystring parameter.

    By default CategoriesList uses CntCatID to pass the CategoryID by querystring, so you have to either to modify the NewsView control (Edit > Advanced > QueryString Keys > Category Key) to expect such parameter or change the key name of the CategoriesList (Edit > Properties > Behavior > CategoryKey) control to be what NewsView is expecting to receive.

    Let us know if this helped you solve your case.

    Greetings,
    Nikola
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Femy
    Femy avatar
    37 posts
    Registered:
    02 Jan 2008
    15 Oct 2008
    Link to this post
    Thx Nikola, I got (1) figured out and  the categories list are  displayed the way I want. Still have issues getting the categories working. When I click on each category list, it still shows all the  items in the News module. I tried setting CategoryID and provider etc that you mentioned. Didnt seem to work. I read somewhere about setting a filter expression but I dont see that in my advanced options. I am using Sf 3.2. Do I need to upgrade?
    TIA
    FR
  4. Joe
    Joe avatar
    138 posts
    Registered:
    24 Sep 2012
    15 Oct 2008
    Link to this post
    Hello Femy,

    Thanks for contacting us.

    The filter option is new for the 3.5 release and you'll need to upgrade by following these instructions. Feel free to open a support ticket if you have any issues.

    Greetings,
    Joe
    the Telerik team

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