# Template Visibility Control

**URL:** <https://forum.inductiveautomation.com/t/template-visibility-control/9244>\
**Category:** Ignition\
**Created:** [October 28, 2014, 5:48pm UTC](https://forum.inductiveautomation.com/t/template-visibility-control/9244 "2014-10-28T17:48:11Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![WildeKurt](https://avatars.discourse-cdn.com/v4/letter/w/50afbb/32.png) [@WildeKurt](https://forum.inductiveautomation.com/u/WildeKurt)\
**Post date:** [October 28, 2014, 5:48pm UTC](https://forum.inductiveautomation.com/t/template-visibility-control/9244/1 "2014-10-28T17:48:11Z")

</div>

Is it possible to control template visibility from within the template? I do not see access to a property from within the template designer.

Kurt

---

<div class="post-metadata">

**Author:** ![jpark](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jpark](https://forum.inductiveautomation.com/u/jpark)\
**Post date:** [October 28, 2014, 7:48pm UTC](https://forum.inductiveautomation.com/t/template-visibility-control/9244/2 "2014-10-28T19:48:02Z")

</div>

Add a vis template parameter. On the main screen, bind the vis parameter to the template’s visible property (bidirectional)

---

<div class="post-metadata">

**Author:** ![WildeKurt](https://avatars.discourse-cdn.com/v4/letter/w/50afbb/32.png) [@WildeKurt](https://forum.inductiveautomation.com/u/WildeKurt)\
**Post date:** [October 29, 2014, 4:55pm UTC](https://forum.inductiveautomation.com/t/template-visibility-control/9244/3 "2014-10-29T16:55:53Z")

</div>

I need to access the visibility property from within the template which doesn’t appear to be possible.

---

<div class="post-metadata">

**Author:** ![Pat](https://avatars.discourse-cdn.com/v4/letter/p/8491ac/32.png) [@Pat](https://forum.inductiveautomation.com/u/Pat)\
**Post date:** [October 29, 2014, 6:00pm UTC](https://forum.inductiveautomation.com/t/template-visibility-control/9244/4 "2014-10-29T18:00:02Z")

</div>

Create a boolean property on the template i.e. TemplateVisible. Manipulate the TemplateVisible value in your template as needed. When you drop the template on a window, go to the template’s Visible property and bind it to the template’s TemplateVisible property.

---

<div class="post-metadata">

**Author:** ![JGJohnson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jgjohnson/32/29582_2.png) [@JGJohnson](https://forum.inductiveautomation.com/u/JGJohnson)\
**Post date:** [October 29, 2014, 6:05pm UTC](https://forum.inductiveautomation.com/t/template-visibility-control/9244/5 "2014-10-29T18:05:03Z")

</div>

It’s not immediately apparent when you are working with templates (at least not to me using 7.5.1) that you can make custom properties on the template that will be available as custom properties on instances.

It took me a while to figure out that when editing a template you can click on the template name (not any of the components being used) and press Ctrl + U to access these parameters and properties. The right-click context menu is no help in this case.

This might be the part of the solution that you are missing.

---

<div class="post-metadata">

**Author:** ![WildeKurt](https://avatars.discourse-cdn.com/v4/letter/w/50afbb/32.png) [@WildeKurt](https://forum.inductiveautomation.com/u/WildeKurt)\
**Post date:** [October 29, 2014, 6:38pm UTC](https://forum.inductiveautomation.com/t/template-visibility-control/9244/6 "2014-10-29T18:38:48Z")

</div>

Having to manipulate after dropping the template onto a window kind of defeats the purpose of having the template to begin with.

---

<div class="post-metadata">

**Author:** ![Pat](https://avatars.discourse-cdn.com/v4/letter/p/8491ac/32.png) [@Pat](https://forum.inductiveautomation.com/u/Pat)\
**Post date:** [October 29, 2014, 6:54pm UTC](https://forum.inductiveautomation.com/t/template-visibility-control/9244/7 "2014-10-29T18:54:39Z")

</div>

Ok, I went a step further. From within the template you can use `event.source.parent.parent.visible = 0`

---

<div class="post-metadata">

**Author:** ![WildeKurt](https://avatars.discourse-cdn.com/v4/letter/w/50afbb/32.png) [@WildeKurt](https://forum.inductiveautomation.com/u/WildeKurt)\
**Post date:** [October 30, 2014, 12:34pm UTC](https://forum.inductiveautomation.com/t/template-visibility-control/9244/8 "2014-10-30T12:34:58Z")

</div>

That works. Interestingly that property doesn’t show up in the property explorer. I will say if you make the template disappear in the template designer it’s a little tricky getting it back.

---

<div class="post-metadata">

**Author:** ![Pat](https://avatars.discourse-cdn.com/v4/letter/p/8491ac/32.png) [@Pat](https://forum.inductiveautomation.com/u/Pat)\
**Post date:** [October 30, 2014, 1:18pm UTC](https://forum.inductiveautomation.com/t/template-visibility-control/9244/9 "2014-10-30T13:18:36Z")

</div>

Under what circumstances are you trying to hide and unhide the template?
