I got it figured out. The problem is that the $object variable appearing in both Person and File embed view templates are in the same scope so after printing out the comment in the Person template, the $object variable now contains the File (due to the File embed view template) instead of the original Person object.
To solve it, I simply add this at the top of the Person template:
{def $person=$object.data_map}
And use $person in place of $object.data_map from then on.
If I had more time, I would write less code.
You must be logged in to post messages in this topic!