Site structure
Version 7.x > Site structure > Accessing Nodes through Repeater View modes: 
User avatar
Member
Member
esolutions - 4/25/2013 9:22:29 AM
   
Accessing Nodes through Repeater
Hi, I have created a folder in the content tree called portals. I have added structured document types to the portal folder. I then need to add three repeater webparts to a template. Is there any way, in each of the repeater web part s to set it to display childnode 1, the second repeater web part to display childnode 2 and finally the third web part to display childnode 3. That way if the client wishes to display the 5th child node in the first repeater the simply have to drag it up to the first position in the content tree. The repeater will then automatically pick up the change.

User avatar
Member
Member
kentico_sandroj - 4/25/2013 5:54:23 PM
   
RE:Accessing Nodes through Repeater
Hi,

I am not exactly clear on how you would like to organize the content but generally speaking, when it comes to paths, almost anything is possible through use of macros and path expressions. Please see the attached screen shot for an example:

User image

If you were to move any pages into the Child1 folder, Repeater 1 would render it. If you were to add pages to Child2, Repeater 2 would render it, etc. You may be able to customize it more, as well as avoid using static paths, by utilizing the path expressions: Expressions

Additionally, macro expressions

User avatar
Member
Member
esolutions - 4/29/2013 9:31:03 AM
   
RE:Accessing Nodes through Repeater
Hi,
Thanks for the reply. Basically the structure would be:
Parent document
|_child document
|_child document
|_child document
Here's what it will look like with the documents named:
Home Page Portals
|_Find What Your Looking For?
|_A Great Way To Go
|_Contact Us
|_What We Can Do For You

I guess I was thinking/hoping that the above could be treated as an array of some sort where array[0] represents "Find What Your Looking For" in the content tree and so on. So in repeater 1 it would always pull from array[0] or the first child node, repeater 2 would always pull from array[1] of the second child node and repeater 3 would always pull from array[3].

If the user decided they wanted What We Can Do For You to display in repeater 1, they would then grab that node and move it up directly under the parent doc in the content tree. So the format would be

Home Page Portals
|_What We Can Do For You
|_Find What Your Looking For?
|_A Great Way To Go
|_Contact Us

And repeater 1 would now display What We Can Do For You.

The content path shown in your screenshot looks as though it needs to uses the name of the path with the child pages nested. Is there a way to do it as described above?

User avatar
Kentico Consulting
Kentico Consulting
Kentico_RichardS - 5/2/2013 4:22:01 AM
   
RE:Accessing Nodes through Repeater
Hi,

Although Im quite lost in what exactly is it that you are seeking but I think that you can use NodeOrder to achieve your goal. Every document has its own NodeOrder (You may see it in the CMS_Tree table - NodeOrder column) and then use it in your repeater in the where condition such as:

where: NodeOrder = '1'

where: NodeOrder = '2'

where: NodeOrder = '3'


Please let me know if this would work in your case.

Kind regards,
Richard Sustek