Kentico 11 Current Item Transformation in Hierarchical Transformation

Pam Reid asked on June 15, 2018 17:49

Hello,

I'm trying to get the "current item" transformation working in a hierarchical transformation that I've set up. I have two document types, one for story and one for organization (each story can have multiple organizations associated with it). I have a search page that displays a list of results, and then when you click on a particular story it goes to the story details page.

The hierarchical transformation for the search results page is working fine, and it correctly displays the associated organizations below the story title. However, once I click through to the details page I can't get the organizations to appear. I have two "current item" transformations in the hierarchical transformation, one for the story page type at level 0 (with a placeholder for the orgs), and one for the organization page type at level 1. This are the same settings I have for the plain "item transformation" in the results, but it's not working in the details and I'm not sure what I'm missing. Can you not have two "current item" transformations like that?

Thanks, Pam

Recent Answers


Brenden Kehren answered on June 18, 2018 20:47

Sounds like you have it setup incorrectly. If the Story is on the same path as the current selected Organization, you will NOT have a selected Story AND a selected Organization because, technically speaking, only the Organization is selected. Your Story will be an item transformation with a sublevel placeholder and the Organization will be the selected or current item transformation.

The current item transformation for Story would display all the Organizations.

  • Story 1
    -- Organization 1
    -- Organization 2

If you have the above structure and your current selected page is /Story-1/Organization-2, the selected document will be an Organization page type and not a Story page type. The Story page type will be on the path, but not selected.

0 votesVote for this answer Mark as a Correct answer

Pam Reid answered on July 3, 2018 20:53

Hi Brendan,

Thank you for your reply. I'm not sure if I'm explaining my setup correctly - the content tree looks as you mentioned:

Story 1
--Organization 1
--Organization 2

When you navigate to Story 1, I'd like it to display:

[Story 1 field 1]

[Org 1 fields]
[Org 2 fields]

[rest of Story 1 fields]

As I mentioned, I have two "current item" transformations in the hierarchical transformation, one for the story page type at level 0 (with a placeholder for the orgs), and one for the organization page type at level 1.

Do I still need to reorganize something to make this work? On the main page where I'm pulling in all the stories, it does correctly nest the orgs under the story titles.

Thanks, Pam

0 votesVote for this answer Mark as a Correct answer

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