ASPX templates
Version 4.x > ASPX templates > Get Child Pages Programmatically View modes: 
User avatar
Member
Member
pedro.cruz-fullsix - 7/30/2009 6:23:54 AM
   
Get Child Pages Programmatically
Hi everyone,

I'm absolutely new to Kentico... But I've worked with other CMS's like Umbraco.
This is what I want to do:

Having this page structure:
- List of articles page
- article 1 page
- article 2 page
- article 3 page

I'm trying to program the template for "List of articles page" and I want to programatically (code behind) get the child pages (into some collection or something), using the Kentico API.
Can someone give me a example of this? I hope what I'm saying makes sense :p

thanks a lot
Pedro

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 7/30/2009 6:32:22 AM
   
RE:Get Child Pages Programmatically
Hi,

For this purpose you can use SelectNodes() method as it is described in following documentation:

http://www.kentico.com/docs/devguide/selecting_nodes.htm

You can get current document alias path using following code:

CMS.CMSHelper.CMSContext.CurrentDocument.NodeAliasPath


Best Regards,
Miroslav Remias.