# Template relative layout

**URL:** <https://forum.inductiveautomation.com/t/template-relative-layout/8395>\
**Category:** Ignition\
**Created:** [April 30, 2014, 11:13am UTC](https://forum.inductiveautomation.com/t/template-relative-layout/8395 "2014-04-30T11:13:39Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![pat.stave](https://avatars.discourse-cdn.com/v4/letter/p/96bed5/32.png) [@pat.stave](https://forum.inductiveautomation.com/u/pat.stave)\
**Post date:** [April 30, 2014, 11:13am UTC](https://forum.inductiveautomation.com/t/template-relative-layout/8395/1 "2014-04-30T11:13:39Z")

</div>

Ok, so to recreate my problem:

I create a new template, and check the “enable layout” checkbox.  
I now place a shape inside, and choose this shape to have “relative layout” and check “maintain aspect ratio”.

When i use this template, and try to resize it in designer, the shape will not resize. Why?

How can i resize a shape inside a template and maintain it’s aspect ratio?

---

<div class="post-metadata">

**Author:** ![adamaustin](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@adamaustin](https://forum.inductiveautomation.com/u/adamaustin)\
**Post date:** [April 30, 2014, 3:14pm UTC](https://forum.inductiveautomation.com/t/template-relative-layout/8395/2 "2014-04-30T15:14:31Z")

</div>

Maybe check the following thread:

[Mark components in template to not resize](http://www.inductiveautomation.com/forum/viewtopic.php?f=70&t=8776)

---

<div class="post-metadata">

**Author:** ![pat.stave](https://avatars.discourse-cdn.com/v4/letter/p/96bed5/32.png) [@pat.stave](https://forum.inductiveautomation.com/u/pat.stave)\
**Post date:** [April 30, 2014, 6:46pm UTC](https://forum.inductiveautomation.com/t/template-relative-layout/8395/3 "2014-04-30T18:46:54Z")

</div>

Hi Adam!  
I have enabled layout, with no effect on this specific problem.

---

<div class="post-metadata">

**Author:** ![adamaustin](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@adamaustin](https://forum.inductiveautomation.com/u/adamaustin)\
**Post date:** [April 30, 2014, 7:04pm UTC](https://forum.inductiveautomation.com/t/template-relative-layout/8395/4 "2014-04-30T19:04:41Z")

</div>

Do you have your controls [wrapped in a container](http://www.inductiveautomation.com/forum/viewtopic.php?f=70&t=8558), besides the rootContainer?

---

<div class="post-metadata">

**Author:** ![pat.stave](https://avatars.discourse-cdn.com/v4/letter/p/96bed5/32.png) [@pat.stave](https://forum.inductiveautomation.com/u/pat.stave)\
**Post date:** [May 1, 2014, 6:03am UTC](https://forum.inductiveautomation.com/t/template-relative-layout/8395/5 "2014-05-01T06:03:32Z")

</div>

At first i did, but for troubleshooting purposes i created a new template with only one shape inside.  
Note that anchored layout works perfectly fine, it is only relative layout that will not function.

Also i don’t think that templates makes use of a “root container” like other windows do (at least it is not represented in the object tree).

---

<div class="post-metadata">

**Author:** ![adamaustin](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@adamaustin](https://forum.inductiveautomation.com/u/adamaustin)\
**Post date:** [May 1, 2014, 1:52pm UTC](https://forum.inductiveautomation.com/t/template-relative-layout/8395/6 "2014-05-01T13:52:26Z")

</div>

Ah, sorry. You are correct about the missing rootContainer. My experience with templates has been minimal and I forgot. I’m afraid we exhausted my knowledge. Sorry, again.

---

<div class="post-metadata">

**Author:** ![jeffkrol](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jeffkrol/32/3339_2.png) [@jeffkrol](https://forum.inductiveautomation.com/u/jeffkrol)\
**Post date:** [May 8, 2014, 5:07pm UTC](https://forum.inductiveautomation.com/t/template-relative-layout/8395/7 "2014-05-08T17:07:42Z")

</div>

Has anyone figured this out yet? I’m having the same issue where the relative layout option for my templates appears to be ignored no matter what I do.

---

<div class="post-metadata">

**Author:** ![jeffkrol](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jeffkrol/32/3339_2.png) [@jeffkrol](https://forum.inductiveautomation.com/u/jeffkrol)\
**Post date:** [May 9, 2014, 4:57pm UTC](https://forum.inductiveautomation.com/t/template-relative-layout/8395/8 "2014-05-09T16:57:31Z")

</div>

So I think I figured out a workaround until someone figures out what is causing the template layout settings to seemingly be ignored. I just use anchored for everything. If I need an object in my template to scale when it is resized, I use an anchored setting on all sides.

If I don’t want something in my template to scale, I use an anchored setting only on the left and top sides.

---

<div class="post-metadata">

**Author:** ![pat.stave](https://avatars.discourse-cdn.com/v4/letter/p/96bed5/32.png) [@pat.stave](https://forum.inductiveautomation.com/u/pat.stave)\
**Post date:** [May 15, 2014, 10:41am UTC](https://forum.inductiveautomation.com/t/template-relative-layout/8395/9 "2014-05-15T10:41:01Z")

</div>

Hi Jeff,

I have also tried this method, however my problem is that i in some cases need to keep the aspect ratio. This will not work when anchored to all sides.
