Nested page types repeater

Tom Troughton asked on March 24, 2015 14:16

I have a page type which allows itself as a child. It represents a hierarchical category. At any level in this hierarchy an editor can add content page type. So my tree can look like this:

- Category 1
    - Category 4
        - CONTENT 1
        - CONTENT 2
    - Category 5
        - CONTENT 3
- Category 2
    - Category 6
        - CONTENT 6
    - Category 7
        - Category 8
            - CONTENT 7
            - CONTENT 8
    - CONTENT 4
    - CONTENT 5
- Category 3
    - CONTENT 9

What I want is to configure a repeater or universal viewer or something which, for every level in this hierarchy, will display the detail of the selected category and list any categories and content pages immediately below. If a content page is selected then display the detail for that.

I need this hierarchy to have unlimited levels.

I'm quite new to Kentico and I think I'm missing some fundamental understanding around how templates and web parts are inherited. For example, I've added a repeater to the menu item under which the hierarchy resides. I've configured this repeater to display the categories at the top of the hierarchy using a preview transformation. Clicking a category then causes the repeater to use the detail transformation to display the detail of the selected category. However, I can't see how to also list the sub-categories and any CONTENT items beneath.

I've also tried using a universal viewer and get the same behaviour. Can someone point me in the right direction to solve this kind of issue? Am I looking at the right kinds of web part? Thanks.

Correct Answer

Brenden Kehren answered on March 24, 2015 14:20

Assuming you'll have multiple page types on different levels, you should check out the Hierarchical Viewer. This along with a hierarchical transformation will allow you to achieve what you're looking for with one query and not needing to nest repeaters (bad for performance). By far this is the best way to go and allows you unlimited nesting assuming you setup your transformations properly.

0 votesVote for this answer Unmark Correct answer

Recent Answers

Tom Troughton answered on March 24, 2015 18:00

Thanks for the reply Brenden. I've had a look at Hierarchical Viewer and it does seem versatile in this way.

I'm sure I'm still missing something in my understanding here. I think it's about how templates are inherited throughout the tree and when pages should behave as menu items, but I guess that's another question!

0 votesVote for this answer Mark as a Correct answer

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