Custom Repeater - ORDER BY NodeOrder, NodeLevel, NodeName NEVER RIGHT

Kayla Johnson asked on May 15, 2018 20:24

I have 3 separate pages - Medical, Vision, Dental, that are getting combined into one page - Benefits. These 3 pages had a folder of documents that were pulled in a Repeater element on the page.

Now, however, on the Benefits page, it has 3 Folders called Medical, Vision, Dental that the documents got moved into.

We've been able to use ORDER BY NodeOrder so far without an issue but now that does not work with these folders. No combination of NodeOrder, NodeLevel, NodeName is ever correct.

How can we have it sort exactly how it looks in the Page Tree?

Correct Answer

Dragoljub Ilic answered on May 17, 2018 11:13

Hi Kayla,

If you are using Universal viewer, you must check 'Load hierarchical data' checkbox in 'Extended settings' section of your web part.

Also, you are using 'First item transformation', but it should be the same 'Item transformation' as used for CMS.File. If you take a look in this link, you will see difference between those two.

Best regards, Dragoljub

0 votesVote for this answer Unmark Correct answer

Recent Answers


Peter Mogilnitski answered on May 15, 2018 21:35

It should be NodeLevel, NodeOrder, NodeName. NodeLevel must be before NodeOrder

0 votesVote for this answer Mark as a Correct answer

Kayla Johnson answered on May 16, 2018 15:25

That does not work either because then it puts the 3 Folders first, then all the sub pages, but the sub pages need to be listed after their corresponding folder.

0 votesVote for this answer Mark as a Correct answer

Dragoljub Ilic answered on May 16, 2018 16:14

Hi Kayla,

What you want to accomplish is perfectly described with hierarchical viewer in kentico. You can implement that with nested repeaters (first to retrieve all 'folders', then for each folder to retrieve sub pages), but that is already supported by hierarchical viewers. You can find more in documentation on this link. NOTE: This is for kentico 10.

Best regards, Dragoljub

0 votesVote for this answer Mark as a Correct answer

Peter Mogilnitski answered on May 16, 2018 19:28

Check out this answer

0 votesVote for this answer Mark as a Correct answer

Kayla Johnson answered on May 16, 2018 23:20

I'm not sure I understand the Universal Viewer/Hierarchical Views.

I have a Universal Viewer set up with Page Types: CMS.Folder;CMS.File But when I assign it a Hierarchical Transformation, data stops displaying on the page.

I made a Hierarchical Transformation for the Folder page type. It looks like this: https://prnt.sc/jit40s

What am I doing wrong?

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.