Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > CMSTreeMenu Custom fields in MenuItem DocumentType View modes: 
User avatar
Member
Member
snk1324 - 6/4/2011 5:24:15 PM
   
CMSTreeMenu Custom fields in MenuItem DocumentType
The TreeMenu webpart is not allowing me to use the custom fields that I added to the MenuItem Document type. The CSS List Menu works fine, but not the tree menu. Some pointers on how to address this?

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 6/5/2011 12:43:39 AM
   
RE:CMSTreeMenu Custom fields in MenuItem DocumentType
Hi,

Could you please provide more details about the issue? I understand that you have created some custom fields in cms.menuitem document type. How these fields should be used in TreeMenu web part? What is your goal?

Thank you for information.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
snk1324 - 6/5/2011 7:24:46 AM
   
RE:CMSTreeMenu Custom fields in MenuItem DocumentType
Sure, I created two fields. ShowInTopNav and ShowInLeftNav. Both of these fields are boolean flags. We have a duel navigation, navigation on the top and the left. For the most part they match, but the client wants some differences in what is on the top nav and what is on the left nav. For the top nav we used the css list menu, and we used the tree menu on the left. For the top nav we set the path to /% and set the where clause to ShowInTopNav=1. This works as expected. For the left nav, we have set the path to /{0}/%, but setting the Where to ShowInLeftNav=1 results in nothing being shown in the navigation at all. I am guessing that the tree uses View_CMS_Tree_Joined, but that does not return the extra fields in the menuitem document type, like the View_CONTENT_MeniItem_Joined does that is used on the topnav.

User avatar
Member
Member
snk1324 - 6/5/2011 7:30:22 AM
   
RE:CMSTreeMenu Custom fields in MenuItem DocumentType
Forgot to mention.. Running 5.5R2, not hot fixes at the moment.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 6/5/2011 8:36:23 AM
   
RE:CMSTreeMenu Custom fields in MenuItem DocumentType
Hi,

Yes, you are right. The css list menu webpart uses View_CONTENT_MenuItem_Joined and the tree menu webpart View_CMS_Tree_Joined to select data.

Alternative solution is to use categories to sort menu items. You could create two custom categories Top and Left (Properties of document, Category tab) and then set Where property of menu web part following way:

DocumentId IN (SELECT DocumentId FROM CMS_DocumentCategory WHERE CategoryId = 6)


Id of category you can find in the CMS_Category table.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
snk1324 - 6/5/2011 3:07:42 PM
   
RE:CMSTreeMenu Custom fields in MenuItem DocumentType
That is awesome. Worked perfectly! Thanks so much for the help.