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

Forums / Developing with Sitefinity / Blog categories

Blog categories

19 posts, 0 answered
  1. Julia Shah
    Julia Shah avatar
    13 posts
    Registered:
    03 Sep 2012
    11 Jul 2008
    Link to this post
    Hi,

    I would like to show blog categories list on by blog page, with links to different categories. How can I do this? Is there a built-in way to show categories? If not, then could you tell me what table they are stored in, so I could develop a custom module?

    Thanks,
    Julia
  2. Nikifor
    Nikifor avatar
    232 posts
    Registered:
    18 May 2013
    14 Jul 2008
    Link to this post
    Hello Julia Shah,

    The Sitefinity package contains the Category View control, which has exactly the functionality you desire. It is enough to set the provider name to Blogs in its properties, so that it would display a list of categories which are link to the exact categorized items (see the attached screenshot). Do the following:
    1. Place the control on a page;
    2. Go to Edit the control;
    3. Expand the Data section and input the provider name.

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

    Greetings,
    Nikifor
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Julia Shah
    Julia Shah avatar
    13 posts
    Registered:
    03 Sep 2012
    08 Aug 2008
    Link to this post
    I have added the categories list to my page, but when I click on a category it shows me posts in different categories, instead of just the one I clicked. What do I need to change?

    http://www.some_url.com/Clients/Blog.aspx?CntCatID=1f32b4f8-9d2c-4778-be78-f5a1be432c1b

    Thanks,
    Julia
  4. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    10 Aug 2008
    Link to this post
    Hello Julia Shah,

    As you may have noticed several of our controls support categorized content (NewsView, EventsView, BlogPosts...) and they all work with Categories List control. In order to associate Categories List control with a control CategoryKey property needs to match on both controls. Here are step by step instructions how to associate CategoriesList control with BlogPosts control on your page:

    1. Hover over Categories List control and click on Edit
    2. Expand Behavior tab
    3. Set the value of CategoryKey property to BlogCatID
    4. Click I'm done
    5. Hover of BlogPosts control and click on Edit
    6. Click on Advanced Tab
    7. Expand QueryStrings tab
    8. Locate the CategoryKey property and make sure its value is BlogCatID (same as in step 3)
    9. Click I'm done and publish the page

    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.
  5. Julia Shah
    Julia Shah avatar
    13 posts
    Registered:
    03 Sep 2012
    11 Aug 2008
    Link to this post

    Thank you for your reply!

    I've changed the Category Key in the Categories List control, but when I try to edit the BlogPosts control, I don't see the things you described. There is no Advanced tab. What I see is this:

    Behavior:
        - CategoryID: 00000000-0000-0000-0000-000000000000
        - CategoryKey: BlogCatID

    QueryString Keys:
        - PageKey: CntPageID
        - ContentProviderKey: BlogProv
        - ContentItemKey: BlogItem

    So what do I need to do? It still doesn't work.

    Thanks,
    Julia
  6. Nikifor
    Nikifor avatar
    232 posts
    Registered:
    18 May 2013
    12 Aug 2008
    Link to this post
    Hello Julia Shah,

    It seems that you are running an older version of Sitefinity and the instructions for it would be a bit different. Here are the updated ones:

    1. Hover over Categories List control and click on Edit
    2. Expand Behavior tab
    3. Set the value of CategoryKey property to BlogCatID

    4. Set the CategoryContentUrl property to point the page where the Blog Post control is placed
    5. Click "I'm done"
    6. Hover over Blog Post control and click on Edit
    7. Locate the CategoryKey property and make sure its value is BlogCatID (same as in step 3)
    8. Click "I'm done" and publish the page

    Please let us know if you need any further information - we will be more than happy to assist you.

    Regards,
    Nikifor
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  7. Julia Shah
    Julia Shah avatar
    13 posts
    Registered:
    03 Sep 2012
    12 Aug 2008
    Link to this post
    I figured it out. I had to select Display Mode as "Auto", not "Item List".

    Thank you for your help!

    Julia
  8. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    12 Aug 2008
    Link to this post
    Hello Julia Shah,

    Great. We are really happy that you were able to solve the problem. 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.
  9. Marko
    Marko avatar
    148 posts
    Registered:
    30 Jul 2008
    29 May 2009
    Link to this post
    Did this procedure change with ver. 3.6?  I used to have a CategoriesList showing all my blog categories, in ver. 3.5, but it's not working correctly anymore.  I am seeing the correct listing of blog categories, but the count of blog posts in each category is incorrect.  For example, it displays this in the CategoriesList:

    Category A (1)
    Category B (7)
    Category C (3)
    Category D (3)

    However, I have a total of 9 blog posts, so if you add the integers above, it's more than 9.  The blog posts are categorized like this (in the blogs module):
    cat A = 1
    cat B = 4
    cat C = 2
    cat D = 2

    This is shown correctly in the Blogs module (in the admin interface), but not in the CategoriesList.

    Any ideas?
  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    29 May 2009
    Link to this post
    Hello Marko,

    Category Lists control caches for 24 hours. I suggest using CategoriesTree control. The control uses built in cache validation. I think that this is the reason why you do not see your categories if you are workin under 3.6.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  11. Marko
    Marko avatar
    148 posts
    Registered:
    30 Jul 2008
    29 May 2009
    Link to this post
    Hi Ivan.

    Hmmm, but why would the CategoriesList control display incorrect numbers, even if caching is involved?  I never had more than 9 total blog posts, and category B, for example, never had more than 4 posts in it (not 7, like it displays).  So it's not like it *used to* have 7 posts in category B, then they changed and we have 4, but it's still being cached as 7 until 24 hours expires...  or something.. Confused about that...

    On the other hand, I tried the CategoriesTree, like you suggested, and it does display the correct numbers.  The only thing that I'm missing here is the ability tpo specify a title for the CategoriesTree.  In CategoriesList control, there is a public property called ControlTitle, but I don't see it in CategoriesTree.  HOWEVER, I opened up the default ExternalTemplate for this control and I do see a placeholder for ControlTitle.

    From Sitefinity\ControlTemplates\Generic_Content\CategoriesTree.aspx:

    <%@ Control Language="C#" %> 
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
     
    <h3> 
        <asp:Literal ID="controlTitle" runat="server"></asp:Literal> 
    </h3> 
     
    <telerik:RadTreeView ID="categoriesTreeView" runat="server"
    </telerik:RadTreeView> 

    So I guess I have two questions at this point:
    1. Is CategoriesList control becoming obsolete (should we always use CategoriesTree instead)?
    2. Why am I not seeing ControlTitle property in the CategoriesTree settings (a bug???)
  12. Sonya
    Sonya avatar
    231 posts
    Registered:
    24 Sep 2012
    30 May 2009
    Link to this post
    Hello Marko,

    Here are answers to your questions:
    1. Is CategoriesList control becoming obsolete (should we always use CategoriesTree instead)?
    Yes, CategoriesList is now an obsolete control (since the CategoriesTree has been introduced).

    2. Why am I not seeing ControlTitle property in the CategoriesTree settings (a bug???)
    You are not seeing the ControlTitle property because we have made an omission to provide it in the CategoriesTree control (the same way as in CategoriesList). So, thank you for driving our attention to this omission. We have updated your Telerik points. The property should be available in one of the upcoming Sitefinity versions. 

    Let us know if you need further assistance.

    Kind regards,
    Sonya
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  13. Marko
    Marko avatar
    148 posts
    Registered:
    30 Jul 2008
    01 Jun 2009
    Link to this post
    Thanks, this clarifies things.  I'll just use CategoriesTree from now on, and I suppose I'll just use a custom template for this particular purpose, and I'll hard-code the title within those h3 tags, for now.

    Thanks for the points.
  14. Marko
    Marko avatar
    148 posts
    Registered:
    30 Jul 2008
    14 Jan 2010
    Link to this post
    Regarding the missing ControlTitle property... I just updated to the latest service pack, and I'm still not seeing this property in the CategoriesTree control.  Is it still on the TODO list or what?  Just wondering... I have been using mapped templates in the meantime to place a custom title.
  15. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    14 Jan 2010
    Link to this post
    Hello Marko,

    The property is not implemented in 3.7 versions. You can easily add it by creating a custom class that inherits from Telerik.Cms.Engine.WebControls.Categories.CategoriesTree. There you need to expose a public property which value will be set to a Label control from the template.

    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.
  16. Marko
    Marko avatar
    148 posts
    Registered:
    30 Jul 2008
    14 Jan 2010
    Link to this post
    I know, but I didn't want to extend a control for something that should be there out of the box.

    But I do have an extended CategoriesTree control which I'm using for some other custom functionality, so I can add controlTitle property there.

    However, I'm not sure which method I should override in order to assign the property to a Label.  I have this so far:
    private string customControlTitle = string.Empty; 
     
    public string CustomControlTitle 
        get 
        { 
            return this.customControlTitle; 
        } 
        set 
        { 
            this.customControlTitle = value; 
        } 
     

    I tried this based on some other code I saw elsewhere, but it didn't work:
    protected override void InitializeControls(System.Web.UI.Control controlContainer) 
        base.InitializeControls(controlContainer); 
     
        ITextControl lblControlTitle = controlContainer.FindControl("Custom_Control_Title"as ITextControl; 
        if (lblControlTitle != null
        { 
            lblControlTitle.Text = this.customControlTitle; 
        } 

  17. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    14 Jan 2010
    Link to this post
    Hi Marko,

    You can use the code as show below

          public string CntlTitle
        {
            get { return this._cntrltitle; }
            set { this._cntrltitle = value; }
        }
     
        private string _cntrltitle;
     
        protected override void InitializeControls(System.Web.UI.Control controlContainer)
        {
            base.InitializeControls(controlContainer);
     
            this.ControlTitle.Text = CntlTitle;
        }

    You can directly call  this.ControlTitle.Text. Do not add your custom property.

    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.
  18. Marko
    Marko avatar
    148 posts
    Registered:
    30 Jul 2008
    14 Jan 2010
    Link to this post
    I see. Thanks, that worked!

    For the record, I would still like to see this built into the regular functionality of CategoriesTree control.  But this works great in the meantime.
  19. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    14 Jan 2010
    Link to this post
    Hello Marko,

    Ok, we will do it for the next SP.

    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
19 posts, 0 answered