Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Many to many relationships using categories? View modes: 
User avatar
Member
Member
vcarter - 6/10/2013 2:20:58 PM
   
Many to many relationships using categories?
As I understand it, user can create categories and assign them to any document as required. I am attempting to create a document filtering mechanism that is managed completely using CMS Desk per our clients request.

I have explored using custom tables, however advanced filtering requires adding a split function to the kentico database as well as the inclusion of custom controls. This solution, while seemingly optimal from a development standpoint, is not currently the preferred method.

I have been reading about custom categories, which on the surface, seem to allow for the creation of many to many relationships while still maintaining the normal CMS workflow of document management.

My question is: Are categories a viable solution to my problem?

So for example. I am managing a document of type news. If I were to create categories for individual business units and regions, then assign these to a given document, based on my current understanding and this example:

http://devnet.kentico.com/docs/5_5r2/devguide/index.html?using_the_category_list_web_part.htm

I could use the category filter to display related documents as needed. Is this correct or would it be using this feature in an unintended manner?

User avatar
Member
Member
kentico_sandroj - 6/14/2013 9:46:23 PM
   
RE:Many to many relationships using categories?
Hello,

I would like to point out that you have posted in a forum for version 7 but the documentation you have linked is for an earlier version. Please clarify which version you are using because it could make a difference.

As for filtering using categories, yes it is possible but you should test it to make sure it works as you expect it to. For example, you have two documents in the following categories:

Doc1 | Cat1
Doc2 | Cat1 > Sub1

If you filter the documents by Cat1, both of the documents will be listed. If that is acceptable for your scenario, then using categories to filter should be fine. Please let me know if you have any additional questions.

Regards,
Sandro

User avatar
Member
Member
vcarter - 6/17/2013 8:13:46 AM
   
RE:Many to many relationships using categories?
Thanks Sandro, I appreciate the response. I am using version 7, but often look at all documentation realizing that some things are different depending on the version. I apologize for the confusion.

It looks like Categories will work for me, though I am still of the opinion that getting the client to add a split function to their db is optimal as I would like this to be as flexible as possible.

Thanks again for the response.

User avatar
Member
Member
kentico_sandroj - 6/25/2013 4:52:58 PM
   
RE:Many to many relationships using categories?
Hi,

You're very welcome. By utilizing macros, and possibly custom macros, you would be able to have more granular control over filtering using categories. Additionally, extending the document types to include a custom category column is always an option. Perhaps if you could explain more about your requirements I may be able to suggest additional solutions - you mentioned it required advanced filtering, what did you mean by that?

Regards,
Sandro

User avatar
Member
Member
vcarter - 6/25/2013 5:39:14 PM
   
RE:Many to many relationships using categories?
I am working on a news management system. The goal is to utilize as much kentico functionality as possible. I have created custom tables for Business Units, Regions, and will possibly have other attributes in the future. A news article can be associated with any combination of these peripheral items.

My end goal is to allow for news filtering, both via a custom control on the public site and also via webservice. Both of these require me to be able to pass parameters(businessUnitID, RegionID, etc.) into my news selection query.

Normally, I would create a news_business and a news_region table, using a join statement to get the relevant news based on what criteria was chosen by the user/service. However in kentico, it has been suggested that adding a custom field to a document type(in this case news) as a container for the relevant associative information.

So my "news" type has the custom fields of BusinessID and RegionID. Which are added to the news form as multi-select checkbox lists. This data is saved to the database as a pipe delimited list.

This means that my options for selecting news items based on BusinessID and/or RegionID are to use LIKE statements to parse the BusinessID and RegionID lists for each article, or to add a spit function to the database allowing for on the fly generation of the join tables.

Normally, I would adjust the database and call it a day, but in this instance kentico and the relevant database are hosted with our client and I do not have readily available access to either code or the db.

My purpose for posting was to try and find an in CMS soultion to my many to many selection problem. I know that kentico is robust and I am far from an expert. So I have been going through the list of things that may be able to meet my needs.

Does that explain what my goal is?

thanks again.

User avatar
Member
Member
kentico_sandroj - 7/1/2013 12:25:25 PM
   
RE:Many to many relationships using categories?
Hello,

Thank you for the additional clarification, it does help us better understand your requirements.

Since you have already extended the document types to include the necessary relationship data, you would be able to use querystring macros to filter articles in the WHERE statement of the Web part which is displaying the data. This approach would work for a Web service or the public site since either one can pass querystring parameters.

This is a fairly common approach and if you do not have reliably access to the code or database, this would probably be the easiest implementation.

May I ask which Web parts you have considered for displaying the news lists/articles?