Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Access node's firstchild & Access property that contains string View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
Nathoushka - 1/18/2011 10:35:09 AM
   
Access node's firstchild & Access property that contains string
I have 2 questions for 2 different things, but I thought it'd be better to ask both on same thread than split them into 2 threads.

First, is there a nice way to access the first child of a folder/page/etc.

Example:
Root
--Folder1
----Page1
----Page2
----Page3
--Folder2

I want to acces the page1 node throught the Folder1 node. I want to select the first node (first child) in the list (from Folder1) and then get the values I need from it.

Secondly, I wanted to know if there is a way to do SQL-Like request on document type properties. In fact, I have various document types with a same part of property (they all contains "Title" in the property name, ex: ArticleTitle) and a if/else is not the best way to do in case they add a new document type, it won't be considered until I change it.

I wanted to know if there is a way I can obtain it like:

string[] myProperty = node.SearchProperties("Title"); // Obtains "ArticleTitle"
node.getValue(myProperty[0]);

Or something like that...

Thanks!

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 1/28/2011 7:20:04 AM
   
RE:Access node's firstchild & Access property that contains string
Hi,

1) Since you know the path to the document (alias path), you can get the first child document according to the value in the NodeOrder column.

2) There is ColumnNames property - so you can get all column names (document type fields) which contains specified substring and then get the values.

Best regards,
Juraj Ondrus