# Understanding a Template's structure: event.source.parent.parent

**URL:** <https://forum.inductiveautomation.com/t/understanding-a-templates-structure-event-source-parent-parent/92581>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [June 30, 2024, 7:01pm UTC](https://forum.inductiveautomation.com/t/understanding-a-templates-structure-event-source-parent-parent/92581 "2024-06-30T19:01:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GilRomero](https://avatars.discourse-cdn.com/v4/letter/g/eb9ed0/32.png) [@GilRomero](https://forum.inductiveautomation.com/u/GilRomero)\
**Post date:** [June 30, 2024, 7:01pm UTC](https://forum.inductiveautomation.com/t/understanding-a-templates-structure-event-source-parent-parent/92581/1 "2024-06-30T19:01:34Z")

</div>

This inquiry is with regards to template structures in Vision.

![Screenshot 2024-06-30 140046](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/7/f733efbcbd8e0c59e90bc19ea79c32a76d240088.png)

I have the following actionPerformed event script configured on a button within a template:  
print event.source.parent.name  
print event.source.parent.parent.name  
print event.source.parent.parent.parent.name

I have placed the template in a Main Window. When I click on the button, I see the following output on the console:  
script\_test  
script\_test  
Root Container

Note that "script\_test" is the name of the template.

I do not have a template nested within a template. Why do both parent and parent.parent reference the template? Do templates have some sort of master structure and substructure?

This is for my own understanding. I appreciate all explanations.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 30, 2024, 10:07pm UTC](https://forum.inductiveautomation.com/t/understanding-a-templates-structure-event-source-parent-parent/92581/2 "2024-06-30T22:07:31Z")

</div>

> [@GilRomero](#):
>
> some sort of master structure and substructure?

Yes. And both template canvas and template repeater have three layers instead of two, to allow for scrolling.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [June 30, 2024, 11:01pm UTC](https://forum.inductiveautomation.com/t/understanding-a-templates-structure-event-source-parent-parent/92581/3 "2024-06-30T23:01:54Z")

</div>

When you drag and drop a template into a window, the template gets placed into a special container called a template holder. The template holder gets the same name as the Vision template.

```python
print event.source.parent. __class__. __name__
print event.source.parent.parent. __class__. __name__
print event.source.parent.parent.parent. __class__. __name__

```

The output will be something like this:  
Vision Template  
Template Holder  
Root Container
