Technical support This forum is closed.
Version 1.x > Technical support > How to: select the current node? View modes: 
User avatar
Member
Member
wtijsma - 2/7/2005 12:02:30 PM
   
How to: select the current node?
Retrieve the current node when I'm in a page?
I mean I know I can get the aliaspath from the request querystring, but also taking all variables in account like multilingual support prefixes, etc...

User avatar
Guest
admin - 2/7/2005 2:45:21 PM
   
Re: How to: select the current node?
Hi Wiebe,

you can retrieve the current node using the following code:

TreeProvider tree = Functions.GetTreeProvider();
TreeNode node = tree.SelectSingleNode("/" + Functions.GetPreferredCulture() + Request.QueryString["aliaspath"], TreePathTypeEnum.AliasPath);

Please note that you may need to modify the Functions.GetPreferredCulture method according to your mechanism for recognizing the current language.

If you need to retrieve the DataRow representing the nearest page (menu item) of the document, you can use this method:

Functions.GetPageInfoDR();

I hope this will help you.

User avatar
Member
Member
wtijsma - 2/8/2005 4:32:14 PM
   
Re: How to: select the current node?
Hi Petr,

Ok, thats good to know...

Thanks