Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > Categories Across Multiple Blogs...Keeping Categories Separate? View modes: 
User avatar
Member
Member
mjantz-crisisprevention - 11/4/2010 3:44:26 PM
   
Categories Across Multiple Blogs...Keeping Categories Separate?
I have 3 blogs on one website, and each requires its own set of categories. However, the way the category list web part is configured is such that it will display every single category from either global, custom, or both.

My question is this: how do I create separate 'groups' of categories that I can use as unique to each particular blog? I need 3 groups of categories for my 3 blogs. Do I simply create a custom table and then point the category list web part to that? How then would I apply these custom categories to individual blog posts?

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 11/16/2010 3:58:13 AM
   
RE:Categories Across Multiple Blogs...Keeping Categories Separate?
Hello,

I respond you via your submitted ticket, but I will pass my answer also here. Maybe it will be helpful to other users as well.

Current design of categories doesn't allow this by default. You would need to use workaround and customization for this. Firstly, you will need to create categories with blog name prefixes: blog1_category1, blog2_category1, etc. This way you'll be able to adjust Category list webpart by setting Where condition with prefix checking.

Speaking about category choosing by editor, this will require customization of Multiple Categories Selector in: ~\CMSAdminControls\Categories\MultipleCategoriesSelector.ascx. Basically, you will need to adjust Unigrid(s) in there by adding WhereClause property. You can check current document in code-behind, what blog does it belongs to. You could use GetUpperTree method to check whether there is appropriate blog with the same name as category prefix in the content tree structure:

protected virtual DataSet GetUpperTree(
string columns,
bool allCultures
)


This will enforce that there will be listed just appropriate categories available for appropriate blog.

Best regards
Ondrej Vasil