title: Smarty templating inheritence - passing variables?
body: <p>Alright to start off I am using the latest Smarty version, and everything is setup.</p>
  
  <p>My problem is that I have a main template for the whole site called layout.tpl, then sub-templates for each of the pages home.tpl, about.tpl ect...</p>
  
  <p>index.php (for home)</p>
  
  <pre><code>require('Smarty.class.php');
  // --
  $smarty = new Smarty;
  $smarty-&gt;template_dir = 'C:/xampp/htdocs/EMP3/view/templates';
  $smarty-&gt;config_dir = 'C:/xampp/htdocs/EMP3/view/config';
  $smarty-&gt;cache_dir = 'C:/xampp/smarty/cache';
  $smarty-&gt;compile_dir = 'C:/xampp/smarty/templates_c';
  $smarty-&gt;display('home.tpl');
  </code></pre>
  
  <p>Home.tpl</p>
  
  <pre><code>{extends file="layout.tpl"}
  {block name=title}Home{/block}
  {block name=body}
  &lt;div&gt;Sample&lt;/div&gt;
  {/block}
  </code></pre>
  
  <p>Layout.tpl</p>
  
  <pre><code>// Long html file which makes use of the blocks from home, about ect...
  </code></pre>
  
  <p>My problem is that the html content in layout.tpl is hidden or shown depending on whether the user is an admin or normal user. How do I pass in these PHP values to layout.tpl? Through home.tpl? Is there a better way to achieve this?</p>
  
  <p>Thanks</p>