API
Version 7.x > API > SelectSingleNode Children Empty View modes: 
User avatar
Member
Member
dom - 1/7/2014 5:57:24 AM
   
SelectSingleNode Children Empty
When i retrieve the SelectSingleNode from the treeprovider. Should it return the children associated to this nodeid?

If not, what can i do to retrieve these children nodes?

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 1/7/2014 6:26:57 AM
   
RE:SelectSingleNode Children Empty
Hello,

Could you please post here the code you are using and describe in more details what exactly do you want to achieve? Because from your description I'm a little bit confused as SelectSingleNode() method is not related to the children nodes directly.

Best regards,
Martin Danko

User avatar
Member
Member
dom - 1/7/2014 6:30:13 AM
   
RE:SelectSingleNode Children Empty
TreeProvider tp = new TreeProvider(CMSContext.CurrentUser);
node = tp.SelectSingleNode(nodeId, CMSContext.PreferredCultureCode);

foreach (var child in node.Children.WithAllData)
{
//step through the children

}


User avatar
Member
Member
dom - 1/7/2014 6:31:21 AM
   
RE:SelectSingleNode Children Empty
strangely it seems to work when logged in to the cmsdesk. Is it a permission thing?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 1/7/2014 6:58:26 AM
   
RE:SelectSingleNode Children Empty
Hello,

Yes, to prevent somebody using e.g. a macro to get data she or he does not have pemrissions to. So, you can allow "Read" permission for the specific document type, or for module Content to the Not authenticated users role. Or, you can use web.config settings key CMSCheckPermissionsForDocumentCollection set to false

Best regards,
Juraj Ondrus