Latte – Undefined variable $ItemType

Vred
Member | 9
+
0
-
10:
11:    {if $getId == "game"}
12:        {var $ItemType = "game"}
13:    {else}
14:        {var $ItemType = "software"}
15:    {/if}
16:
17:
18:    <div class="single-main">
19:
20:        <h1 class="title" n:block=title>Add {$ItemType} to list</h1>
Latte:

Warning
Undefined variable $ItemType

Yes, I can work around the problem by writing the condition in the presenter.

David Grudl
Nette Core | 8229
+
0
-

You're probably prints something on lines 1..9. Put the condition at the top.