Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Groups in Categories View modes: 
User avatar
Member
Member
ahmed.sarhan-dream-makers - 12/23/2010 7:00:40 AM
   
Groups in Categories
I would like to know how in the groups page can i view groups in categories, i want the groups created on my portal to be organized and viewed in categories

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 12/23/2010 8:54:28 PM
   
RE:Groups in Categories
Hello,

Categorizing by placement under particular folder is possible for documents or probably group pages, however Groups are not bound with content structure, therefore different means of categorizing are required. Our Categories module is only for Documents, so it's not suitable for your aim too.

You can add a custom field (column) for the Group system table - described at http://devnet.kentico.com/docs/devguide/system_tables_overview.htm
You can create new custom attribute, e.g."GroupCategory", of type Integer number, with default value 0 and with Field type DropDown list.

In the Options box for the DropDown field type, you could use options like:

0;(none)
1;Internal
2;External

You will need to modify the page in CMSDesk / Tools / Groups, so that it will show the dropdown list - ~\CMSModules\Groups\Controls\GroupEdit.ascx
so the dropdown list will show and offer those options (and none by default), and will store the value into the DB as defined next to the option name.
It is also possible to add the field (label and input control) to the Alternative form for usage in the live site / Group profile pages...

Then, in your webparts or pages code, you can access the field using GetValue method, like:

categoryid = CommunityContext.CurrentGroup.GetIntegerValue("GroupCategory", 0);

You can also use it e.g. in Groups viewer webpart in Where Condition ... value "GroupCategory = 1" will make the webpart to show just "Internal" Groups, etc...

Hope this will help.

Regards,
Zdenek