Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > CMS.TreeEngine.TreeProvider.SelectNodes() is not returning results for multiple classnames when specified View modes: 
User avatar
Member
Member
joeh42 - 5/6/2011 11:05:39 AM
   
CMS.TreeEngine.TreeProvider.SelectNodes() is not returning results for multiple classnames when specified
CMS.TreeEngine.TreeProvider.SelectNodes() is not returning results for multiple classnames when specified

DataSet documents = tree.SelectNodes(CMSContext.CurrentSiteName, "/%", "en-us", true, "custom.Article;CMS.News;custom.Resource", String.Empty, "[DocumentName]", -1, false, -1, "[ClassDisplayName], [DocumentName], [NodeAliasPath], [ClassName]")

I am setting the int parameters to -1 that I do not want to use, and the string params as String.Empty.

What isn't working correctly?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 5/6/2011 3:46:35 PM
   
RE:CMS.TreeEngine.TreeProvider.SelectNodes() is not returning results for multiple classnames when specified
Hi,

How do you check that there are no results returned? Is the data set empty when you run it in debug?

Also, I would give it a try using this syntax:

tree.SelectNodes(CMSContext.CurrentSiteName, "/%", "en-us", true, "custom.Article;CMS.News;custom.Resource", null, "DocumentName", -1, false, 0, "ClassDisplayName, DocumentName, NodeAliasPath, ClassName")

for TopN parameter there is zero instead of -1 and also you do not need to use the square brackets.

This way it works just fine for me.

Best regards,
Juraj Ondrus