Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Need help to understand CMS.TreeEngine.TreeNode View modes: 
User avatar
Member
Member
sheeba.chandran-lobaansoftwares - 9/12/2013 2:55:33 AM
   
Need help to understand CMS.TreeEngine.TreeNode
Hello,

Can anyone help me out to understand the following few lines of code:-


TreeProvider provider = new TreeProvider(CMSContext.CurrentUser);
CMS.TreeEngine.TreeNode parent = provider.SelectSingleNode(CMSContext.CurrentSiteName, "/Company/Partners", "en-us", true);

What is the use of second parameter "/Company/Partners" and how to decide this parameter.
because in my project i am getting null value for parent variable.

User avatar
Kentico Support
Kentico Support
kentico_filipl - 9/12/2013 3:08:14 AM
   
RE:Need help to understand CMS.TreeEngine.TreeNode
Hello,

Parameters for SelectSingleNode method are (String siteName, String aliasPath, String cultureCode, Boolean combineWithDefaultCulture) in this case. AliasPath is the path to the document (which is a TreeNode object) you want to retrieve. So if you do not have such a document under "/Company/Partners" path (you can check it in CMS Desk -> Content -> Content management), the method returns null.

A complete list of all API methods can be found in API Reference.

Best regards,
Filip Ligac