Smarty Access from site.inc.php

Discussion in 'Customization & add-ons' started by adam_and, Jun 30, 2010.

  1. adam_and

    adam_and New Member

    Joined:
    Aug 22, 2006
    Messages:
    6
    How would I access the smarty variable from site.inc.php? My site has dynamic banner ads displayed as part of the template (included in the header.html) and they are rendered in the page via smarty.

    I need to be able to assign the markup to the smarty object. Is there a global smarty object or a better way to go about doing this?
  2. adam_and

    adam_and New Member

    Joined:
    Aug 22, 2006
    Messages:
    6
    I have added code to the common.inc.php new_smarty() function to achieve what I need but this is obviously not the ideal solution.
  3. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    You can also add global variables from smarty :
    {php}
    $GLOBALS[var_name] = $this->_tpl_vars[smarty_variable_name];
    {/php}
    And then access $GLOBALS[var_name] from site.inc.php

Share This Page