title: Smarty framework if/else statement always goes to the "if" part
body: <p>On a certain page of my website (that uses PHP and the smarty templating framework), I have a map of the world on which I display information. I propose several types of color pallet to the user in order to help with the visibility of the information displayed. Each time the user changes his selection of color pallet, I reload the page by changing a parameter in the URL. For example, </p>
  
  <pre><code>www.mywebsite.com/home.php?id=norm_d_maps&amp;mpn=norms&amp;FromMonth=05&amp;FromDay=16&amp;v=1&amp;**palette=1**&amp;labels=0&amp;intervals=10&amp;min=&amp;max=&amp;lon=-7836935.6349316&amp;lat=6193233.778916&amp;zoom=5
  </code></pre>
  
  <p>will become</p>
  
  <pre><code>www.mywebsite.com/home.php?id=norm_d_maps&amp;mpn=norms&amp;FromMonth=05&amp;FromDay=16&amp;v=1&amp;**palette=2**&amp;labels=0&amp;intervals=10&amp;min=&amp;max=&amp;lon=-7836935.6349316&amp;lat=6193233.778916&amp;zoom=5
  </code></pre>
  
  <p>In order to catch that change, as mentioned earlier, I reload the page with the new URL and catch each of its parameters and redisplay the page like follows:</p>
  
  <pre><code>$page = Map::fromId('468BE166-A38D-43C9-B61B-3AA72BC50210');
  
  echo '&lt;h1&gt;' . fct_traduire('txt_norm_d_maps') . '&lt;/h1&gt;';
  
  $page-&gt;tplEngine-&gt;assign('LANGUAGE', $session-&gt;lang);
  $page-&gt;tplEngine-&gt;assign('LOGGED_IN', $session-&gt;isLoggedIn());
  $page-&gt;tplEngine-&gt;assign('MENU', generate_navigation( $GLOBALS['g_section'] ));
  **$page-&gt;tplEngine-&gt;assign('PALETTE', $_GET['palette']);**
  $page-&gt;tplEngine-&gt;assign('MIN', $_GET['min']);
  $page-&gt;tplEngine-&gt;assign('MAX', $_GET['max']);
  $page-&gt;openlayers_DailyNormalsAndExtremes($_GET['FromMonth'], $_GET['FromDay'], $_GET['v'], $_GET['labels'], $_GET['palette'], $_GET['intervals'], $_GET['lon'], $_GET['lat'], $_GET['zoom'], $_GET['clustered'], $_GET['min'], $_GET['max']);
  $page-&gt;tplEngine-&gt;display('extends:map_layout.html|' . $page-&gt;display());
  </code></pre>
  
  <p>The part of map_layout.html in which I use those options has the following structure:</p>
  
  <pre><code>&lt;div&gt;
      &lt;table&gt;
          &lt;tbody&gt;
              &lt;tr&gt;
                  **{if $PALETTE == 1}**
                  &lt;td with a certain background color&gt;
                  **{else}**
                  &lt;td with another background color&gt;
                  **{/if}**
                  ...
              &lt;/tr&gt;
              ...
          &lt;/tbody&gt;
      &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Unfortunately, even if the palette parameter in the URL is 2, the td node has the background color of the first if condition each time (so it is as if palette == 1 when it is actually == 2). Later in my code, I use the MIN and MAX parameters and they seem to change properly each time I reload the page with the new values for them that the user chose.</p>
  
  <p>What am I doing wrong here?</p>
  
  <p>EDIT: I just displayed the value of the palette, min and max parameters on my webpage, and while the min and max are indeed the good values the user chose, the palette parameter is "Palette" instead of being 1 or 2 or anything other integer the user chooses.. What could cause this?</p>