Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > How to filter CMSSitemap View modes: 
User avatar
Member
Member
Anuj - 11/25/2009 1:32:39 AM
   
How to filter CMSSitemap
Hello,

I am using CMSSiteMap and User Control (.ascx) in my CMS page.

My CMS pages belong to different categories which I have created in CMS and I displayed all categories list in the dropdownlist available in User Control.

I am able to show SiteMap on my this page where a list of all available pages are available.

But I want to show the list of pages as per the category. I will choose category name from the above dropdownlist control available in User Control means I wish to filter the list of pages available in SiteMap as per their category.

Please tell me that how could I assign WHERE clause and also How could I get selected value name of dropdownlist in CMSSiteMap.

I am trying to get over this problem this but still didn’t find any proper solution.

Please provide me a proper solution so that I could sort out my above problem in CMS.

Thanks a lot in Advance.

Regards,
Anuj

User avatar
Kentico Developer
Kentico Developer
kentico_martind - 11/28/2009 4:22:49 AM
   
RE:How to filter CMSSitemap
Hi Anuj,

you could create copy of CMSSiteMap web part and put dropdown list directly into this copied web part.

Then you can set WhereCondition property of SiteMap dynamically in code-behind of the web part in according to value currently selected in dropdown list:

this.smElem.WhereCondition = "DocumentID IN (SELECT DocumentID FROM CMS_DocumentCategory WHERE CategoryID = " + drpList.SelectedValue.ToString() + ")";


Best Regards,

Martin Dobsicek